Malabarba / control-pianobar

Pair of scripts that interact with pianobar entirely through notification bubbles and hotkeys. No terminal necessary.
http://malabarba.github.io/control-pianobar/
35 stars 13 forks source link

XDG_CONFIG_HOME is not always set, this fixes it. #6

Open duffolonious opened 9 years ago

duffolonious commented 9 years ago

If $XDG_CONFIG_HOME is not defined, default to $HOME/.config

(used /etc/profile.d/bash_completion.sh as the example of this usage):

⟫ git diff
diff --git a/pianobar-notify.sh b/pianobar-notify.sh
index fb0dd6d..c7db572 100755
--- a/pianobar-notify.sh
+++ b/pianobar-notify.sh
@@ -28,7 +28,7 @@
 # pianobar config file.
 #
 # Also check if this matches you config folder
-fold="$XDG_CONFIG_HOME/pianobar"
+fold="${XDG_CONFIG_HOME:-$HOME/.config}/pianobar"

 # You should also place the control-pianobar.sh script in the
 # config folder (or modify the following variable accordingly).
duffolonious commented 9 years ago

This needs to be done in pianobar-control as well.

Malabarba commented 9 years ago

Thanks for the report. I'm on holiday atm, but I'll be back soon. Would you like to try to open a Pull Request with this?