diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/startfluxbox.in | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/util/startfluxbox.in b/util/startfluxbox.in index bbe7bf6..7e5de20 100755 --- a/util/startfluxbox.in +++ b/util/startfluxbox.in | |||
@@ -1,15 +1,41 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # $Id$ | 2 | # $Id$ |
3 | if [ -x ~/.fluxbox/startup ]; then | 3 | |
4 | exec ~/.fluxbox/startup | 4 | command="`basename \"$0\"`" |
5 | elif [ -r ~/.fluxbox/startup ]; then | 5 | startup="~/.fluxbox/startup" |
6 | exec sh ~/.fluxbox/startup | 6 | |
7 | while [ $# -gt 0 ]; do | ||
8 | case "$1" in | ||
9 | -c|--config) | ||
10 | if [ $# -lt 2 ]; then | ||
11 | echo "$command:error, missing argument" | ||
12 | exit 1 | ||
13 | fi | ||
14 | shift | ||
15 | startup=$1 | ||
16 | ;; | ||
17 | -h|--help) cat <<EOF | ||
18 | Usage: $command [-h] [-c startupfile] | ||
19 | EOF | ||
20 | exit | ||
21 | ;; | ||
22 | esac | ||
23 | shift | ||
24 | done | ||
25 | |||
26 | exit 0 | ||
27 | |||
28 | |||
29 | if [ -x "$startup" ]; then | ||
30 | exec "$startup" | ||
31 | elif [ -r "$startup" ]; then | ||
32 | exec sh "$startup" | ||
7 | else | 33 | else |
8 | if [ ! -d ~/.fluxbox ]; then | 34 | if [ ! -d ~/.fluxbox ]; then |
9 | mkdir -p ~/.fluxbox/{backgrounds,styles,pixmaps} | 35 | mkdir -p ~/.fluxbox/{backgrounds,styles,pixmaps} |
10 | fi | 36 | fi |
11 | if [ ! -r ~/.fluxbox/startup ]; then | 37 | if [ ! -r "$startup" ]; then |
12 | cat << EOF > ~/.fluxbox/startup | 38 | cat << EOF > "$startup" |
13 | # fluxbox startup-script: | 39 | # fluxbox startup-script: |
14 | # | 40 | # |
15 | # Lines starting with a '#' are ignored. | 41 | # Lines starting with a '#' are ignored. |
@@ -61,6 +87,6 @@ exec @pkgbindir@/fluxbox | |||
61 | # exec @pkgbindir@/fluxbox -log ~/.fluxbox/log | 87 | # exec @pkgbindir@/fluxbox -log ~/.fluxbox/log |
62 | EOF | 88 | EOF |
63 | fi | 89 | fi |
64 | chmod 755 ~/.fluxbox/startup | 90 | chmod 755 "$startup" |
65 | exec ~/.fluxbox/startup | 91 | exec "$startup" |
66 | fi | 92 | fi |