From: paul Date: Sun, 10 Dec 2017 00:47:26 +0000 (+0000) Subject: guess environment variables only if not already set X-Git-Url: http://git.plutz.net/?p=serve0;a=commitdiff_plain;h=f7105de02571c492625e7a9d034ee613b382f8c1 guess environment variables only if not already set svn path=/trunk/; revision=195 --- diff --git a/actions/playctl.sh b/actions/playctl.sh index 9af8f7b..ae1a51b 100755 --- a/actions/playctl.sh +++ b/actions/playctl.sh @@ -21,8 +21,8 @@ statusfile="${_DATA}/mplayer.status" statusfile="/tmp/mplayer.status" volfile="${_DATA}/mplayer.volume" -export DISPLAY=":0" -export XDG_RUNTIME_DIR="/run/user/$(id |sed -rn '1s;.*uid=([0-9]+)[^0-9].*;\1;p')" +[ -z "$DISPLAY" ] && export DISPLAY=":0" +[ -z "$XDG_RUNTIME_DIR" ] && export XDG_RUNTIME_DIR="/run/user/$(id |sed -rn '1s;.*uid=([0-9]+)[^0-9].*;\1;p')" printf '\rBREAK\r' >> "$statusfile"