aboutsummaryrefslogtreecommitdiff
path: root/util/startfluxbox.in
diff options
context:
space:
mode:
authormathias <mathias>2005-03-17 00:05:50 (GMT)
committermathias <mathias>2005-03-17 00:05:50 (GMT)
commit99ec2b49e0496425a245157d4fed811754032d3b (patch)
treedafb40664e7334d1ef38662a855e99720cfbeb08 /util/startfluxbox.in
parentd6befe5371c5df7d719cb184c4d20e38dc841a13 (diff)
downloadfluxbox_pavel-99ec2b49e0496425a245157d4fed811754032d3b.zip
fluxbox_pavel-99ec2b49e0496425a245157d4fed811754032d3b.tar.bz2
added -c <startupfile> to startfluxbox so one can have different startup-files
Diffstat (limited to 'util/startfluxbox.in')
-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