all repos — fluxbox @ c5b67f9a42731e5841bfd40e41268ed308225b30

custom fork of the fluxbox windowmanager

portability fixes for couple of shell scripts
simonb simonb
commit

c5b67f9a42731e5841bfd40e41268ed308225b30

parent

9ec117da1ab522c7dbcfd03d71fcc5aaf8b16f1a

3 files changed, 21 insertions(+), 17 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,10 @@

(Format: Year/Month/Day) Changes for 0.9.16: *06/04/17: + * Fix /bin/sh portability for fbsetbg and startfluxbox (Simon) + (fluxbox-generate_menu is seriously broken wrt portability + atm though :-/) + fbsetbg startfluxbox.in * Make autogen.sh properly /bin/sh portable (Simon) Fixes #1445464 autogen.sh
M util/fbsetbgutil/fbsetbg

@@ -46,8 +46,8 @@ # TODO purheps: xprop -root _WIN_WORKSPACE

# _NET_CURRENT_DESKTOP # The wallpapersetter is selected in this order -wpsetters=${wpsetters:=Esetroot wmsetbg feh hsetroot chbg display qiv xv xsri xli xsetbg} # broken icewmbg' -lastwallpaper=${HOME}/.fluxbox/lastwallpaper +wpsetters="${wpsetters:=Esetroot wmsetbg feh hsetroot chbg display qiv xv xsri xli xsetbg}" # broken icewmbg' +lastwallpaper="${HOME}/.fluxbox/lastwallpaper" WHOAMI=`whoami`

@@ -200,8 +200,8 @@ exit 1

fi # create directory and last wallpaper file -if [ ! -d ~/.fluxbox ]; then - mkdir ~/.fluxbox +if [ ! -d "$HOME/.fluxbox" ]; then + mkdir "$HOME/.fluxbox" touch ${lastwallpaper} fi

@@ -482,20 +482,20 @@

# random wallpaper code if [ "$option" = random ]; then # Lets make one thing clear... - wallpaperdir=$wallpaper + wallpaperdir="$wallpaper" if [ -z "$wallpaperdir" ]; then message "No random wallpaper directory specified." exit 1 fi if [ -d "$wallpaperdir" ]; then - number_of_wallpapers=`ls $wallpaperdir|wc -l` + number_of_wallpapers=`ls "$wallpaperdir"|wc -l` if find_it random_number; then - randomnumber=$(random_number) + randomnumber=`random_number` # some shells don't support $RANDOM - elif [ -z $RANDOM ]; then + elif [ -z "$RANDOM" ]; then randomnumber=`(echo $$ ;time ps; w ; date )2>&1 | cksum | cut -f1 -d' '` else - randomnumber=$RANDOM + randomnumber="$RANDOM" fi wallpapernumber=`expr $randomnumber % $number_of_wallpapers + 1` #remember previous wallpaper

@@ -504,7 +504,7 @@ remembercommand

fi remember=false #set -x - wallpaper="$wallpaperdir/`ls $wallpaperdir|sed -n ${wallpapernumber}p`" + wallpaper="$wallpaperdir/`ls \"$wallpaperdir\"|sed -n ${wallpapernumber}p`" option='$aspect' # have to choose something... else message "Invalid random wallpaper directory specified."
M util/startfluxbox.inutil/startfluxbox.in

@@ -2,7 +2,7 @@ #!/bin/sh

# $Id$ command="`basename \"$0\"`" -startup=~/.fluxbox/startup +startup="$HOME/.fluxbox/startup" while [ $# -gt 0 ]; do case "$1" in

@@ -28,8 +28,8 @@ exec "$startup"

elif [ -r "$startup" ]; then exec sh "$startup" else - if [ ! -d ~/.fluxbox ]; then - mkdir -p ~/.fluxbox/backgrounds ~/.fluxbox/styles ~/.fluxbox/pixmaps + if [ ! -d "$HOME/.fluxbox" ]; then + mkdir -p "$HOME/.fluxbox/backgrounds" "$HOME/.fluxbox/styles" "$HOME/.fluxbox/pixmaps" fi if [ ! -r "$startup" ]; then ( cat << EOF

@@ -40,7 +40,7 @@

# You can set your favourite wallpaper here if you don't want # to do it from your style. # -# bsetbg -f ~/pictures/wallpaper.png +# bsetbg -f $HOME/pictures/wallpaper.png # # This sets a black background

@@ -58,13 +58,13 @@ # Increase the keyboard repeat-rate:

# xset r rate 195 35 # # Your own fonts-dir: -# xset +fp $HOME/.font +# xset +fp "$HOME/.fonts" # # Your favourite mouse cursor: # xsetroot -cursor_name right_ptr # # Change your keymap: -# xmodmap ~/.Xmodmap +# xmodmap "$HOME/.Xmodmap"

@@ -81,7 +81,7 @@ # Because it is the last app you have to run it with ''exec'' before it.

exec @pkgbindir@/fluxbox # or if you want to keep a log: -# exec @pkgbindir@/fluxbox -log ~/.fluxbox/log +# exec @pkgbindir@/fluxbox -log "$HOME/.fluxbox/log" EOF ) > "$startup" fi