From f7105de02571c492625e7a9d034ee613b382f8c1 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 10 Dec 2017 00:47:26 +0000 Subject: [PATCH] guess environment variables only if not already set svn path=/trunk/; revision=195 --- actions/playctl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" -- 2.39.2