diff options
author | Florian Pritz <f-p@gmx.at> | 2008-10-27 19:04:02 +0100 |
---|---|---|
committer | Florian Pritz <f-p@gmx.at> | 2008-10-27 19:04:02 +0100 |
commit | 283f5e991820f025cec7ce35769d2628c99c90d2 (patch) | |
tree | 8fc8a870861f1c0de070fc95246cdf6cae296d40 | |
parent | 63cf678bbc63caa8499ffddab25ccd79b9581443 (diff) | |
download | bin-283f5e991820f025cec7ce35769d2628c99c90d2.tar.gz bin-283f5e991820f025cec7ce35769d2628c99c90d2.tar.xz |
added DISPLAY check to set-background.sh
-rwxr-xr-x[-rw-r--r--] | reformat_fstab.pl | 0 | ||||
-rwxr-xr-x | set-background.sh | 13 |
2 files changed, 7 insertions, 6 deletions
diff --git a/reformat_fstab.pl b/reformat_fstab.pl index 9c81d8d..9c81d8d 100644..100755 --- a/reformat_fstab.pl +++ b/reformat_fstab.pl 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 <http://www.gnu.org/licenses/>. - -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 <file>"; @@ -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 |