summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2009-06-21 14:51:32 +0200
committerMichael Stapelberg <michael@stapelberg.de>2009-06-21 14:51:32 +0200
commit3577560e90772d6a4f6352db9d4cdb2e4f8a9549 (patch)
tree5495656671f7554343806c55b1e9b217515f2f52 /debian
parenta3707bae7ea42913c98c6779ced3c3f82f3300d6 (diff)
debian: add initscripts/default files
Diffstat (limited to 'debian')
-rw-r--r--debian/i3status.i3status-wmii.default9
-rwxr-xr-xdebian/i3status.i3status-wmii.init43
2 files changed, 52 insertions, 0 deletions
diff --git a/debian/i3status.i3status-wmii.default b/debian/i3status.i3status-wmii.default
new file mode 100644
index 0000000..15b2883
--- /dev/null
+++ b/debian/i3status.i3status-wmii.default
@@ -0,0 +1,9 @@
+### i3status-wmii settings ###
+
+## run i3status-wmii: yes, no
+## default: no
+I3STATUS_WMII_ENABLE=no
+
+## additional options:
+## -c <configfile>
+I3STATUS_WMII_OPTIONS=""
diff --git a/debian/i3status.i3status-wmii.init b/debian/i3status.i3status-wmii.init
new file mode 100755
index 0000000..91e63e3
--- /dev/null
+++ b/debian/i3status.i3status-wmii.init
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: i3status-wmii
+# Required-Start:
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Generates a status line for wmii
+# Description: Generates a status line for wmii
+### END INIT INFO
+
+# For the pidfile, you must be root. i3status itself runs as user just fine
+[ $(id -ru) -eq 0 ] || { echo "You need to be root"; exit 1; }
+
+[ -f /etc/default/i3status-wmii ] && . /etc/default/i3status-wmii
+
+if [ "$I3STATUS_WMII_ENABLE" != "yes" ]
+then
+ echo "Not starting i3status-wmii (Disabled in /etc/default/i3status-wmii)"
+ exit 0
+fi
+
+. /lib/lsb/init-functions
+
+case "$1" in
+start) log_daemon_msg "Starting wmii status bar filler" "i3status-wmii"
+ start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/i3status-wmii.pid --name i3status-wmii --startas /usr/bin/i3status-wmii
+ log_end_msg $?
+ ;;
+stop) log_daemon_msg "Stopping wmii status bar filler" "i3status-wmii"
+ start-stop-daemon --stop --quiet --pidfile /var/run/i3status-wmii.pid --name i3status-wmii
+ log_end_msg $?
+ ;;
+restart|reload|force-reload) log_daemon_msg "Restarting wmii status bar filler" "i3status-wmii"
+ start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/i3status-wmii.pid --name i3status-wmii
+ start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/i3status-wmii.pid --name i3status-wmii --startas /usr/bin/i3status-wmii
+ ;;
+*) log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
+ exit 2
+ ;;
+esac
+exit 0