From e5d51808abcb5d12a03ed8a4edf9a28fa356e88e Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Mon, 21 Nov 2022 19:58:18 +0100 Subject: bin/iconez: handle missing system directories --- bin/iconez | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/iconez b/bin/iconez index 104158e..f000b6d 100755 --- a/bin/iconez +++ b/bin/iconez @@ -40,7 +40,7 @@ by_name() { [ -z "${fuzzy}" ] && name="^${name}$" # try getting .desktop entry for name # shellcheck disable=2086 - ident=$(fd -e desktop "${name}" ${desktop_dirs} -x grep Icon= | cut -d= -f2 | uniq) + ident=$(fd -e desktop "${name}" ${desktop_dirs} -x grep Icon= 2>/dev/null || true | cut -d= -f2 | uniq) fi if [ -z "${fuzzy}" ]; then @@ -55,7 +55,7 @@ by_name() { fi # shellcheck disable=2086 - fd -t f ${filetypes} "${ident}" ${icon_dirs} + fd -t f ${filetypes} "${ident}" ${icon_dirs} 2>/dev/null || true # avoid selecting svg, can be made to prefer svg if `-v` is removed # svg=$(printf "%s" "${icons}" | grep -v svg) -- cgit 1.4.1