summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <michael+x200@stapelberg.de>2009-04-17 13:31:53 +0200
committerMichael Stapelberg <michael+x200@stapelberg.de>2009-04-17 13:31:53 +0200
commit1ff4d5a8ce8b52a05f4a4eff8c440d316265ee65 (patch)
tree6b2a2b601ccd1277d9922f3d3818005adc777eec
parent1bef3dca5b9ab404e017037ed309907e1ac796c3 (diff)
Replace wmiistatus with i3status in files
-rw-r--r--Makefile20
-rw-r--r--i3status.170
-rw-r--r--i3status.c10
-rwxr-xr-xi3status.init22
4 files changed, 77 insertions, 45 deletions
diff --git a/Makefile b/Makefile
index 5347ecb..00abff1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,32 +1,34 @@
CFLAGS+=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
CFLAGS+=-g
+CFLAGS+=-std=gnu99
+CFLAGS+=-pedantic
CFLAGS+=-DPREFIX=\"\"
ifeq ($(shell uname),Linux)
CFLAGS+=-DLINUX
endif
-# Define this if you want wmiistatus to spit out dzen2-compatible output on stdout
+# Define this if you want i3status to spit out dzen2-compatible output on stdout
CFLAGS+=-DDZEN
-wmiistatus: wmiistatus.o wmiistatus.h
+i3status: i3status.o i3status.h
clean:
rm -f *.o
distclean: clean
- rm -f wmiistatus
+ rm -f i3status
install:
install -m 755 -d $(DESTDIR)/usr/bin
install -m 755 -d $(DESTDIR)/etc/init.d
install -m 755 -d $(DESTDIR)/usr/share/man/man1
- install -m 755 wmiistatus $(DESTDIR)/usr/bin/wmiistatus
- install -m 755 wmiistatus.init $(DESTDIR)/etc/init.d/wmiistatus
- install -m 644 wmiistatus.conf $(DESTDIR)/etc/wmiistatus.conf
- install -m 644 wmiistatus.1 $(DESTDIR)/usr/share/man/man1
+ install -m 755 i3status $(DESTDIR)/usr/bin/i3status
+ install -m 755 i3status.init $(DESTDIR)/etc/init.d/i3status
+ install -m 644 i3status.conf $(DESTDIR)/etc/i3status.conf
+ install -m 644 i3status.1 $(DESTDIR)/usr/share/man/man1
release:
- tar cjf wmiistatus.tar.bz2 *.c *.h *.1 *.conf *.init Makefile
+ tar cjf i3status.tar.bz2 *.c *.h *.1 *.conf *.init Makefile
-all: wmiistatus
+all: i3status
diff --git a/i3status.1 b/i3status.1
index cf599e5..747d9fa 100644
--- a/i3status.1
+++ b/i3status.1
@@ -8,68 +8,96 @@
.fi
..
-.TH wmiistatus 1 "FEBRUARY 2009" Linux "User Manuals"
+.TH i3status 1 "APRIL 2009" Linux "User Manuals"
.SH NAME
-wmiistatus \- fill wmii's status bar
+i3status \- Generates a status line for dzen2 or wmii
.SH SYNOPSIS
-.B wmiistatus
+.B i3status
.RB [\|\-c
.IR configfile \|]
.SH DESCRIPTION
-.B wmiistatus
-is a small program (around 500 SLOC) for filling wmii's status bar via its 9P pseudo filesystem. It is designed to be very efficient by issuing a very small number of systemcalls (as the bar should be updated every second or at your specified interval).
+.B i3status
+is a small program (around 500 SLOC) for filling dzen2 or wmii's status bar via
+its 9P pseudo filesystem. It is designed to be very efficient by issuing a very
+small number of systemcalls (as the bar should be updated every second or at
+your specified interval). This ensures that even under high load, your status bar
+is updated correctly and it saves a little bit of battery life by not spawning
+new processes every second like shell scripts do.
.SH CONFIGURATION
.TP
.B wlan
-Specifies the name of your WLAN interface (e.g. wlan0 or ath0 or eth1). Don't specify if you don't have a WLAN interface or if it should not be displayed.
+Specifies the name of your WLAN interface (e.g. wlan0 or ath0 or eth1). Don't
+specify if you don't have a WLAN interface or if it should not be displayed.
.TP
.B eth
-Specifies the name of your ethernet interface (e.g. eth0). Don't specify if you don't have an ethernet interface or if it should not be displayed.
+Specifies the name of your ethernet interface (e.g. eth0). Don't specify if you
+don't have an ethernet interface or if it should not be displayed.
.TP
.B wmii_path
-Specifies the path to the rbar-folder of your mounted wmii pseudo file system (e.g. /mnt/wmii/rbar/). It has to be terminated by a slash.
+Specifies the path to the rbar-folder of your mounted wmii pseudo file system
+(e.g. /mnt/wmii/rbar/). It has to be terminated by a slash.
.TP
.B time_format
-Format for the time/date to be displayed. See strftime(3) or date(1). Don't specify it if you don't want the time to be shown.
+Format for the time/date to be displayed. See strftime(3) or date(1). Don't
+specify it if you don't want the time to be shown.
.TP
.B battery_path
-The path to your battery's uevent file in /sys, e.g. /sys/class/power_supply/BAT0/uevent. Only interesting for you if you have more than one battery. Don't specify if you don't have a battery.
+The path to your battery's uevent file in /sys, e.g.
+/sys/class/power_supply/BAT0/uevent. You can specify this directive multiple
+times to display data of more than one battery. Don't specify if you don't have
+a battery.
.TP
.B run_watch
-You can specify this directive multiple times. Each line first has a name (one word, separated by space) followed by a path (can contain wildcards, given to glob(3)). The path is the path to a PID-file which contains just the process ID of a process. wmiistatus will then check if the process is still running and displays "yes" or "no" depending on the status. This is useful for displaying if your VPN is running, or dhclient for DHCP and so on...
+You can specify this directive multiple times. Each line first has a name (one
+word, separated by space) followed by a path (can contain wildcards, given to
+glob(3)). The path is the path to a PID-file which contains just the process ID
+of a process. i3status will then check if the process is still running and
+displays "yes" or "no" depending on the status. This is useful for displaying
+if your VPN is running, or dhclient for DHCP and so on...
.TP
.B order
-Followed by a comma separated list of the modules (run, wlan, eth, battery, load, time) this directive specifies the order of the information which should be displayed. An order is accomplished by prefixing the files in wmii's /rbar directory with a number, that is 0VPN, 1DHCP, 2time and so on..
+Followed by a comma separated list of the modules (run, wlan, eth, battery,
+load, time) this directive specifies the order of the information which should
+be displayed. An order is accomplished by prefixing the files in wmii's /rbar
+directory with a number, that is 0VPN, 1DHCP, 2time and so on..
.TP
.B color
-If specified, color mode is on. This affects WLAN which will be displayed red if WLAN is down and the run_watch system which will display the status in red/green.
+If specified, color mode is on. This affects WLAN which will be displayed red
+if WLAN is down and the run_watch system which will display the status in
+red/green.
.TP
.B get_ethspeed
-Get current speed of the ethernet interface using the same mechanism as ethtool. You need to start wmiistatus with root privileges to use this.
+Get current speed of the ethernet interface using the same mechanism as
+ethtool. You need to start i3status with root privileges to use this.
.TP
.B normcolors
-Specifies the colors for background/border in the same format (html colorcodes) as wmii's configuration (just the last two values), that is #222222 #333333 for example. Text color will be determined automatically (red/green/#888888), depending on context.
+Specifies the colors for background/border in the same format (html colorcodes)
+as wmii's configuration (just the last two values), that is #222222 #333333 for
+example. Text color will be determined automatically (red/green/#888888),
+depending on context.
.TP
.B interval
-Specifies the interval in which the status bar will be updated. If you got a very slow system or feel you don't need so much information, you may want to increase it.
+Specifies the interval in which the status bar will be updated. If you got a
+very slow system or feel you don't need so much information, you may want to
+increase it.
.SH FILES
.TP
-.B /etc/wmiistatus.conf
+.B /etc/i3status.conf
System-wide configuration file.
.SH EXAMPLE CONFIGURATION
@@ -97,7 +125,9 @@ modprobe 9pnet_fd
.Ve
.SH BUGS
-Sometimes, wmiistatus crashes when the wlan interface vanishes (killswitch). I haven't yet found the bug, as it is not reproducible. If you can reproduce this, please fix it and send me a patch.
+Sometimes, i3status crashes when the wlan interface vanishes (killswitch). I
+haven't yet found the bug, as it is not reproducible. If you can reproduce
+this, please fix it and send me a patch.
.SH SEE ALSO
.BR strftime (3),
@@ -105,7 +135,7 @@ Sometimes, wmiistatus crashes when the wlan interface vanishes (killswitch). I h
.BR glob (3)
.SH AUTHOR
-Michael Stapelberg <michael+wmiistatus at stapelberg dot de>
+Michael Stapelberg <michael+i3status at stapelberg dot de>
.SH WEBSITE
-See http://michael.stapelberg.de/wmiistatus for the newest release.
+See http://michael.stapelberg.de/i3status for the newest release.
diff --git a/i3status.c b/i3status.c
index c0a1fe3..cb56373 100644
--- a/i3status.c
+++ b/i3status.c
@@ -1,8 +1,8 @@
/*
- * Generates a status line for use with wmii or other minimal window managers
+ * i3status – Generates a status line for dzen2 or wmii
*
*
- * Copyright (c) 2008-2009 Michael Stapelberg and contributors
+ * Copyright © 2008-2009 Michael Stapelberg and contributors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@@ -64,7 +64,7 @@
#include <sys/resource.h>
#endif
-#include "wmiistatus.h"
+#include "i3status.h"
#define BAR "^fg(#333333)^p(5;-2)^ro(2)^p()^fg()^p(5)"
@@ -610,7 +610,7 @@ int main(int argc, char *argv[]) {
pathbuf[512];
unsigned int i;
- char *configfile = PREFIX "/etc/wmiistatus.conf";
+ char *configfile = PREFIX "/etc/i3status.conf";
int o, option_index = 0;
struct option long_options[] = {
{"config", required_argument, 0, 'c'},
@@ -624,7 +624,7 @@ int main(int argc, char *argv[]) {
if ((char)o == 'c')
configfile = optarg;
else if ((char)o == 'h') {
- printf("wmiistatus (c) 2008-2009 Michael Stapelberg\n"
+ printf("i3status (c) 2008-2009 Michael Stapelberg\n"
"Syntax: %s [-c <configfile>]\n", argv[0]);
return 0;
}
diff --git a/i3status.init b/i3status.init
index fa30339..9b5ea6d 100755
--- a/i3status.init
+++ b/i3status.init
@@ -1,32 +1,32 @@
#!/bin/sh
#
### BEGIN INIT INFO
-# Provides: wmiistatus
+# Provides: i3status
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
-# Short-Description: little application to fill up wmii's status bar
-# Description: little application to fill up wmii's status bar
+# Short-Description: Generates a status line for dzen2 or wmii
+# Description: Generates a status line for dzen2 or wmii
### END INIT INFO
-# For the pidfile, you must be root. wmiistatus itself runs as user just fine
+# 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; }
. /lib/lsb/init-functions
case "$1" in
-start) log_daemon_msg "Starting wmii status bar filler" "wmiistatus"
- start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/wmiistatus.pid --name wmiistatus --startas /usr/bin/wmiistatus
+start) log_daemon_msg "Starting wmii status bar filler" "i3status"
+ start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/i3status.pid --name i3status --startas /usr/bin/i3status
log_end_msg $?
;;
-stop) log_daemon_msg "Stopping wmii status bar filler" "wmiistatus"
- start-stop-daemon --stop --quiet --pidfile /var/run/wmiistatus.pid --name wmiistatus
+stop) log_daemon_msg "Stopping wmii status bar filler" "i3status"
+ start-stop-daemon --stop --quiet --pidfile /var/run/i3status.pid --name i3status
log_end_msg $?
;;
-restart|reload|force-reload) log_daemon_msg "Restarting wmii status bar filler" "wmiistatus"
- start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/wmiistatus.pid --name wmiistatus
- start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/wmiistatus.pid --name wmiistatus --startas /usr/bin/wmiistatus
+restart|reload|force-reload) log_daemon_msg "Restarting wmii status bar filler" "i3status"
+ start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/i3status.pid --name i3status
+ start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/i3status.pid --name i3status --startas /usr/bin/i3status
;;
*) log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 2