diff options
| author | Robert Günzler <r@gnzler.io> | 2023-07-12 20:29:01 +0900 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2023-07-12 20:29:01 +0900 |
| commit | 55e12519e03a44ee6c2ef99cc6829b9fbebdcc46 (patch) | |
| tree | 74665b6c5a1653b6b302b4445e176dd7d181b053 /bin | |
| parent | fbbea1e4a92bbd96c4db33c50a9c441a5f844af1 (diff) | |
bin/iconez: pickup XDG_DATA_DIRS
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/iconez | 15 |
1 files changed, 13 insertions, 2 deletions
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 |