From 55e12519e03a44ee6c2ef99cc6829b9fbebdcc46 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Wed, 12 Jul 2023 20:29:01 +0900 Subject: bin/iconez: pickup XDG_DATA_DIRS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- bin/iconez | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/iconez b/bin/iconez index f000b6d..9c78450 100755 --- a/bin/iconez +++ b/bin/iconez @@ -30,8 +30,19 @@ while getopts n:p:dfsh opt; do done shift $((OPTIND - 1)) -desktop_dirs="/usr/share/applications/ /usr/local/share/applications/" -icon_dirs="/usr/share/icons/ /usr/local/share/icons/" +data_dirs=$( + set -f + IFS=":" + set -- ${XDG_DATA_DIRS:-"$HOME/.local/share:/usr/local/share:/usr/share"} + printf "%s\n" "$@" +) + +desktop_dirs= +icon_dirs= +for d in $data_dirs; do + desktop_dirs="${desktop_dirs## } ${d}/applications" + icon_dirs="${icon_dirs## } ${d}/icons" +done by_name() { name=$1 -- cgit 1.4.1