diff options
author | simonb <simonb> | 2006-04-17 09:47:40 (GMT) |
---|---|---|
committer | simonb <simonb> | 2006-04-17 09:47:40 (GMT) |
commit | c5b67f9a42731e5841bfd40e41268ed308225b30 (patch) | |
tree | c305af07430c12cd011ebb5153147b1db734f3d2 | |
parent | 9ec117da1ab522c7dbcfd03d71fcc5aaf8b16f1a (diff) | |
download | fluxbox_pavel-c5b67f9a42731e5841bfd40e41268ed308225b30.zip fluxbox_pavel-c5b67f9a42731e5841bfd40e41268ed308225b30.tar.bz2 |
portability fixes for couple of shell scripts
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | util/fbsetbg | 20 | ||||
-rwxr-xr-x | util/startfluxbox.in | 14 |
3 files changed, 21 insertions, 17 deletions
@@ -1,6 +1,10 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 0.9.16: | 2 | Changes for 0.9.16: |
3 | *06/04/17: | 3 | *06/04/17: |
4 | * Fix /bin/sh portability for fbsetbg and startfluxbox (Simon) | ||
5 | (fluxbox-generate_menu is seriously broken wrt portability | ||
6 | atm though :-/) | ||
7 | fbsetbg startfluxbox.in | ||
4 | * Make autogen.sh properly /bin/sh portable (Simon) | 8 | * Make autogen.sh properly /bin/sh portable (Simon) |
5 | Fixes #1445464 | 9 | Fixes #1445464 |
6 | autogen.sh | 10 | autogen.sh |
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 |
49 | wpsetters=${wpsetters:=Esetroot wmsetbg feh hsetroot chbg display qiv xv xsri xli xsetbg} # broken icewmbg' | 49 | wpsetters="${wpsetters:=Esetroot wmsetbg feh hsetroot chbg display qiv xv xsri xli xsetbg}" # broken icewmbg' |
50 | lastwallpaper=${HOME}/.fluxbox/lastwallpaper | 50 | lastwallpaper="${HOME}/.fluxbox/lastwallpaper" |
51 | 51 | ||
52 | 52 | ||
53 | WHOAMI=`whoami` | 53 | WHOAMI=`whoami` |
@@ -200,8 +200,8 @@ if [ $# -eq 0 ]; then | |||
200 | fi | 200 | fi |
201 | 201 | ||
202 | # create directory and last wallpaper file | 202 | # create directory and last wallpaper file |
203 | if [ ! -d ~/.fluxbox ]; then | 203 | if [ ! -d "$HOME/.fluxbox" ]; then |
204 | mkdir ~/.fluxbox | 204 | mkdir "$HOME/.fluxbox" |
205 | touch ${lastwallpaper} | 205 | touch ${lastwallpaper} |
206 | fi | 206 | fi |
207 | 207 | ||
@@ -482,20 +482,20 @@ fi | |||
482 | # random wallpaper code | 482 | # random wallpaper code |
483 | if [ "$option" = random ]; then | 483 | if [ "$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 | ||
4 | command="`basename \"$0\"`" | 4 | command="`basename \"$0\"`" |
5 | startup=~/.fluxbox/startup | 5 | startup="$HOME/.fluxbox/startup" |
6 | 6 | ||
7 | while [ $# -gt 0 ]; do | 7 | while [ $# -gt 0 ]; do |
8 | case "$1" in | 8 | case "$1" in |
@@ -28,8 +28,8 @@ if [ -x "$startup" ]; then | |||
28 | elif [ -r "$startup" ]; then | 28 | elif [ -r "$startup" ]; then |
29 | exec sh "$startup" | 29 | exec sh "$startup" |
30 | else | 30 | else |
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 | ||
82 | exec @pkgbindir@/fluxbox | 82 | exec @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" |
85 | EOF | 85 | EOF |
86 | ) > "$startup" | 86 | ) > "$startup" |
87 | fi | 87 | fi |