all repos — fluxbox @ 99ec2b49e0496425a245157d4fed811754032d3b

custom fork of the fluxbox windowmanager

added -c <startupfile> to startfluxbox so one can have different startup-files
mathias mathias
commit

99ec2b49e0496425a245157d4fed811754032d3b

parent

d6befe5371c5df7d719cb184c4d20e38dc841a13

1 files changed, 34 insertions(+), 8 deletions(-)

jump to
M util/startfluxbox.inutil/startfluxbox.in

@@ -1,15 +1,41 @@

#!/bin/sh # $Id$ -if [ -x ~/.fluxbox/startup ]; then - exec ~/.fluxbox/startup -elif [ -r ~/.fluxbox/startup ]; then - exec sh ~/.fluxbox/startup + +command="`basename \"$0\"`" +startup="~/.fluxbox/startup" + +while [ $# -gt 0 ]; do + case "$1" in + -c|--config) + if [ $# -lt 2 ]; then + echo "$command:error, missing argument" + exit 1 + fi + shift + startup=$1 + ;; + -h|--help) cat <<EOF +Usage: $command [-h] [-c startupfile] +EOF + exit + ;; + esac + shift +done + +exit 0 + + +if [ -x "$startup" ]; then + exec "$startup" +elif [ -r "$startup" ]; then + exec sh "$startup" else if [ ! -d ~/.fluxbox ]; then mkdir -p ~/.fluxbox/{backgrounds,styles,pixmaps} fi - if [ ! -r ~/.fluxbox/startup ]; then - cat << EOF > ~/.fluxbox/startup + if [ ! -r "$startup" ]; then + cat << EOF > "$startup" # fluxbox startup-script: # # Lines starting with a '#' are ignored.

@@ -61,6 +87,6 @@ # or if you want to keep a log:

# exec @pkgbindir@/fluxbox -log ~/.fluxbox/log EOF fi - chmod 755 ~/.fluxbox/startup - exec ~/.fluxbox/startup + chmod 755 "$startup" + exec "$startup" fi