summaryrefslogtreecommitdiff
path: root/mpc-notify
diff options
context:
space:
mode:
authorboredpasta <boredpasta@tutanota.com>2023-07-17 16:22:13 +0300
committerboredpasta <boredpasta@tutanota.com>2023-07-17 16:35:36 +0300
commit5b28cf7d2b6511e175bfb9abb7580f5e89481bcb (patch)
tree07c4c749d1ffb4855a474203583b58201d3ae5d8 /mpc-notify
parent5a9b36fbe5736cae4ef82e02d48e2270e801f9fb (diff)
mpc-notify: directly source user-dirs.dirs to silence SC1090
Diffstat (limited to 'mpc-notify')
-rwxr-xr-xmpc-notify8
1 files changed, 3 insertions, 5 deletions
diff --git a/mpc-notify b/mpc-notify
index f570698..9c74329 100755
--- a/mpc-notify
+++ b/mpc-notify
@@ -27,14 +27,12 @@ preview_width=64
preview_height=64
default_song_icon="media-playback-start"
-# find xdg directories
-xdg_config_home="${XDG_CONFIG_HOME:-$HOME/.config}"
-xdg_user_dirs="${xdg_config_home}/user-dirs.dirs"
-[ -f "$xdg_user_dirs" ] && . "$xdg_user_dirs"
+# find xdg music directory
+. "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" 2>/dev/null || true
xdg_music_dir="${XDG_MUSIC_DIR:-$HOME/Music}"
# find mpc config directory
-mpc_config_dir="$xdg_config_home/mpc"
+mpc_config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/mpc"
[ -d "$mpc_config_dir" ] || mkdir -p "$mpc_config_dir"
# issue an mpc command based on arguments and assemble notification message