From 283f5e991820f025cec7ce35769d2628c99c90d2 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 27 Oct 2008 19:04:02 +0100 Subject: added DISPLAY check to set-background.sh --- set-background.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'set-background.sh') diff --git a/set-background.sh b/set-background.sh index 06d1fd7..3b2a234 100755 --- a/set-background.sh +++ b/set-background.sh @@ -22,8 +22,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - -export DISPLAY=:0.0 +if [ "" = $DISPLAY ]; then + export DISPLAY=:0.0 +fi if [ "$1" = "" ] || [ "$1" = "-h" ]; then notify-send -t 10000 "Background" "Usage: set-background "; @@ -31,11 +32,11 @@ if [ "$1" = "" ] || [ "$1" = "-h" ]; then fi FILE=$1 -if [ -f $FILE ] ; then - echo "feh --bg-center $FILE" > "/home/flo/.fehbg"; - ln -sf "$FILE" "/home/flo/backgrounds/current_bg"; +if [ -f $FILE ]; then + echo "feh --bg-center ${FILE}" > "/home/flo/.fehbg"; + ln -sf "${FILE}" "/home/flo/backgrounds/current_bg"; source /home/flo/.fehbg else - notify-send -t 10000 "Background" "Error: File \"$FILE\" doesn't exist"; + notify-send -t 10000 "Background" "Error: File \"${FILE}\" doesn't exist"; exit 1 fi -- cgit v1.2.3-24-g4f1b