summaryrefslogtreecommitdiff
path: root/util/fbsetbg
diff options
context:
space:
mode:
authorsimonb <simonb>2006-04-17 09:47:40 (GMT)
committersimonb <simonb>2006-04-17 09:47:40 (GMT)
commitc5b67f9a42731e5841bfd40e41268ed308225b30 (patch)
treec305af07430c12cd011ebb5153147b1db734f3d2 /util/fbsetbg
parent9ec117da1ab522c7dbcfd03d71fcc5aaf8b16f1a (diff)
downloadfluxbox_lack-c5b67f9a42731e5841bfd40e41268ed308225b30.zip
fluxbox_lack-c5b67f9a42731e5841bfd40e41268ed308225b30.tar.bz2
portability fixes for couple of shell scripts
Diffstat (limited to 'util/fbsetbg')
-rw-r--r--util/fbsetbg20
1 files changed, 10 insertions, 10 deletions
diff --git a/util/fbsetbg b/util/fbsetbg
index 5e58e19..b633222 100644
--- a/util/fbsetbg
+++ b/util/fbsetbg
@@ -46,8 +46,8 @@
46# _NET_CURRENT_DESKTOP 46# _NET_CURRENT_DESKTOP
47 47
48# The wallpapersetter is selected in this order 48# The wallpapersetter is selected in this order
49wpsetters=${wpsetters:=Esetroot wmsetbg feh hsetroot chbg display qiv xv xsri xli xsetbg} # broken icewmbg' 49wpsetters="${wpsetters:=Esetroot wmsetbg feh hsetroot chbg display qiv xv xsri xli xsetbg}" # broken icewmbg'
50lastwallpaper=${HOME}/.fluxbox/lastwallpaper 50lastwallpaper="${HOME}/.fluxbox/lastwallpaper"
51 51
52 52
53WHOAMI=`whoami` 53WHOAMI=`whoami`
@@ -200,8 +200,8 @@ if [ $# -eq 0 ]; then
200fi 200fi
201 201
202# create directory and last wallpaper file 202# create directory and last wallpaper file
203if [ ! -d ~/.fluxbox ]; then 203if [ ! -d "$HOME/.fluxbox" ]; then
204 mkdir ~/.fluxbox 204 mkdir "$HOME/.fluxbox"
205 touch ${lastwallpaper} 205 touch ${lastwallpaper}
206fi 206fi
207 207
@@ -482,20 +482,20 @@ fi
482# random wallpaper code 482# random wallpaper code
483if [ "$option" = random ]; then 483if [ "$option" = random ]; then
484 # Lets make one thing clear... 484 # Lets make one thing clear...
485 wallpaperdir=$wallpaper 485 wallpaperdir="$wallpaper"
486 if [ -z "$wallpaperdir" ]; then 486 if [ -z "$wallpaperdir" ]; then
487 message "No random wallpaper directory specified." 487 message "No random wallpaper directory specified."
488 exit 1 488 exit 1
489 fi 489 fi
490 if [ -d "$wallpaperdir" ]; then 490 if [ -d "$wallpaperdir" ]; then
491 number_of_wallpapers=`ls $wallpaperdir|wc -l` 491 number_of_wallpapers=`ls "$wallpaperdir"|wc -l`
492 if find_it random_number; then 492 if find_it random_number; then
493 randomnumber=$(random_number) 493 randomnumber=`random_number`
494 # some shells don't support $RANDOM 494 # some shells don't support $RANDOM
495 elif [ -z $RANDOM ]; then 495 elif [ -z "$RANDOM" ]; then
496 randomnumber=`(echo $$ ;time ps; w ; date )2>&1 | cksum | cut -f1 -d' '` 496 randomnumber=`(echo $$ ;time ps; w ; date )2>&1 | cksum | cut -f1 -d' '`
497 else 497 else
498 randomnumber=$RANDOM 498 randomnumber="$RANDOM"
499 fi 499 fi
500 wallpapernumber=`expr $randomnumber % $number_of_wallpapers + 1` 500 wallpapernumber=`expr $randomnumber % $number_of_wallpapers + 1`
501 #remember previous wallpaper 501 #remember previous wallpaper
@@ -504,7 +504,7 @@ if [ "$option" = random ]; then
504 fi 504 fi
505 remember=false 505 remember=false
506 #set -x 506 #set -x
507 wallpaper="$wallpaperdir/`ls $wallpaperdir|sed -n ${wallpapernumber}p`" 507 wallpaper="$wallpaperdir/`ls \"$wallpaperdir\"|sed -n ${wallpapernumber}p`"
508 option='$aspect' # have to choose something... 508 option='$aspect' # have to choose something...
509 else 509 else
510 message "Invalid random wallpaper directory specified." 510 message "Invalid random wallpaper directory specified."