X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=actions%2Fplayctl.sh;h=ae1a51bc19f21c7372e0c464561e75e08b9a39e6;hb=c59fd5a4946c4d13fc1692e4561878a9bb2b3e17;hp=9af8f7b8d0c5d9af813ad8eb451feb41aef2721f;hpb=e2388ebb332a514f070ec5a668f23b08dda83546;p=serve0 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"