all repos — fluxbox @ dcdfdfd56b5dbb6453062ad60876647b11433f18

custom fork of the fluxbox windowmanager

utils: remove bashisms

fbsetbg: The random number generation used 'time' shell internal, which
does not exist in all shells.  Allowing 'ps' output to be part of cksum
input will increase entropy and enhance quality of the randomness.

fbsetbg: The second fix is more important.  In posix shell there is no
'==' comparision operator.

fluxbox-generate_menu: There are no quarantees about echo accepting
options, so use 'printf' for more advanced outputing.
Sami Kerola kerolasa@iki.fi
commit

dcdfdfd56b5dbb6453062ad60876647b11433f18

parent

e15dfaf4639f7b46c55b414efac8dbd38629ae75

2 files changed, 7 insertions(+), 3 deletions(-)

jump to
M util/fbsetbgutil/fbsetbg

@@ -505,7 +505,11 @@ if find_it random_number; then

randomnumber=`random_number` # some shells don't support $RANDOM elif [ -z "$RANDOM" ]; then - randomnumber=`(echo $$ ;time ps; w ; date )2>&1 | cksum | cut -f1 -d' '` + if [ -r /dev/urandom ]; then + randomnumber=`hexdump -n 2 -e '/2 "%u"' /dev/urandom` + else + randomnumber=`(echo $$; ps; w; date) 2>&1 | cksum | cut -f1 -d' '` + fi else randomnumber="$RANDOM" fi

@@ -526,7 +530,7 @@ fi

if [ ! -r "$wallpaper" ]; then - if [ "$ignore_missing_wallpaper" == "true" ]; then + if [ "$ignore_missing_wallpaper" = "true" ]; then exit 0 fi message "Can't find wallpaper $wallpaper"
M util/fluxbox-generate_menu.inutil/fluxbox-generate_menu.in

@@ -331,7 +331,7 @@ # echo "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>"

if [ -f "$entry_icon" ]; then # if icon exists and entry does not already exists, add it if ! grep -q -m 1 "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>" $ICONMAPPING 2> /dev/null; then - echo -e "\"${entry_exec}\" \t <${entry_icon}>" >> $ICONMAPPING + printf "\"${entry_exec}\" \t <${entry_icon}>\n" >> $ICONMAPPING else : echo "# mapping already exists for ${entry_exec}" >> $ICONMAPPING fi