aboutsummaryrefslogtreecommitdiff
path: root/util
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
parent9ec117da1ab522c7dbcfd03d71fcc5aaf8b16f1a (diff)
downloadfluxbox-c5b67f9a42731e5841bfd40e41268ed308225b30.zip
fluxbox-c5b67f9a42731e5841bfd40e41268ed308225b30.tar.bz2
portability fixes for couple of shell scripts
Diffstat (limited to 'util')
-rw-r--r--util/fbsetbg20
-rwxr-xr-xutil/startfluxbox.in14
2 files changed, 17 insertions, 17 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."
diff --git a/util/startfluxbox.in b/util/startfluxbox.in
index 920fb5e..6be6236 100755
--- a/util/startfluxbox.in
+++ b/util/startfluxbox.in
@@ -2,7 +2,7 @@
2# $Id$ 2# $Id$
3 3
4command="`basename \"$0\"`" 4command="`basename \"$0\"`"
5startup=~/.fluxbox/startup 5startup="$HOME/.fluxbox/startup"
6 6
7while [ $# -gt 0 ]; do 7while [ $# -gt 0 ]; do
8 case "$1" in 8 case "$1" in
@@ -28,8 +28,8 @@ if [ -x "$startup" ]; then
28elif [ -r "$startup" ]; then 28elif [ -r "$startup" ]; then
29 exec sh "$startup" 29 exec sh "$startup"
30else 30else
31 if [ ! -d ~/.fluxbox ]; then 31 if [ ! -d "$HOME/.fluxbox" ]; then
32 mkdir -p ~/.fluxbox/backgrounds ~/.fluxbox/styles ~/.fluxbox/pixmaps 32 mkdir -p "$HOME/.fluxbox/backgrounds" "$HOME/.fluxbox/styles" "$HOME/.fluxbox/pixmaps"
33 fi 33 fi
34 if [ ! -r "$startup" ]; then 34 if [ ! -r "$startup" ]; then
35 ( cat << EOF 35 ( cat << EOF
@@ -40,7 +40,7 @@ else
40# You can set your favourite wallpaper here if you don't want 40# You can set your favourite wallpaper here if you don't want
41# to do it from your style. 41# to do it from your style.
42# 42#
43# bsetbg -f ~/pictures/wallpaper.png 43# bsetbg -f $HOME/pictures/wallpaper.png
44# 44#
45# This sets a black background 45# This sets a black background
46 46
@@ -58,13 +58,13 @@ else
58# xset r rate 195 35 58# xset r rate 195 35
59# 59#
60# Your own fonts-dir: 60# Your own fonts-dir:
61# xset +fp $HOME/.font 61# xset +fp "$HOME/.fonts"
62# 62#
63# Your favourite mouse cursor: 63# Your favourite mouse cursor:
64# xsetroot -cursor_name right_ptr 64# xsetroot -cursor_name right_ptr
65# 65#
66# Change your keymap: 66# Change your keymap:
67# xmodmap ~/.Xmodmap 67# xmodmap "$HOME/.Xmodmap"
68 68
69 69
70 70
@@ -81,7 +81,7 @@ else
81 81
82exec @pkgbindir@/fluxbox 82exec @pkgbindir@/fluxbox
83# or if you want to keep a log: 83# or if you want to keep a log:
84# exec @pkgbindir@/fluxbox -log ~/.fluxbox/log 84# exec @pkgbindir@/fluxbox -log "$HOME/.fluxbox/log"
85EOF 85EOF
86 ) > "$startup" 86 ) > "$startup"
87 fi 87 fi