aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutil/startfluxbox.in42
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$
3if [ -x ~/.fluxbox/startup ]; then 3
4 exec ~/.fluxbox/startup 4command="`basename \"$0\"`"
5elif [ -r ~/.fluxbox/startup ]; then 5startup="~/.fluxbox/startup"
6 exec sh ~/.fluxbox/startup 6
7while [ $# -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
18Usage: $command [-h] [-c startupfile]
19EOF
20 exit
21 ;;
22 esac
23 shift
24done
25
26exit 0
27
28
29if [ -x "$startup" ]; then
30 exec "$startup"
31elif [ -r "$startup" ]; then
32 exec sh "$startup"
7else 33else
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
62EOF 88EOF
63 fi 89 fi
64 chmod 755 ~/.fluxbox/startup 90 chmod 755 "$startup"
65 exec ~/.fluxbox/startup 91 exec "$startup"
66fi 92fi