summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.config/wmii-hg/autostart6
-rwxr-xr-x.config/wmii-hg/rbar_acpi15
-rwxr-xr-x.config/wmii-hg/rbar_battery9
-rwxr-xr-x.config/wmii-hg/rbar_clock8
-rwxr-xr-x.config/wmii-hg/rbar_cpu12
-rwxr-xr-x.config/wmii-hg/rbar_wifi17
6 files changed, 40 insertions, 27 deletions
diff --git a/.config/wmii-hg/autostart b/.config/wmii-hg/autostart
index cee702a..156fe7d 100755
--- a/.config/wmii-hg/autostart
+++ b/.config/wmii-hg/autostart
@@ -10,5 +10,7 @@ daemon dunst &> /dev/null
daemon blueman-applet &> /dev/null
daemon clipit -dn &> /dev/null
-#Action rbar_cpu 01 &
-Action rbar_clock 99 &
+PATH="$WMII_CONFPATH:$PATH"
+daemon rbar_acpi 97_acpi &> /dev/null
+daemon rbar_wifi 98_wifi &> /dev/null
+daemon rbar_clock 99_clock &> /dev/null
diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi
new file mode 100755
index 0000000..1771875
--- /dev/null
+++ b/.config/wmii-hg/rbar_acpi
@@ -0,0 +1,15 @@
+#!/bin/bash
+. include.sh
+
+id=$1
+trap "rm -f ${WMII_DIR}/rbar/${id}.*" EXIT
+
+while connected_to_x_server; do
+ acpi -bt | sed -r \
+ -e 's/^([A-Z])[a-z]+ ([0-9]+):/\1\2:/' \
+ -e 's/\s*degrees\s*/°/g' |
+ cat -n | while read -r n line; do
+ printf "label %s\n" "$line" >> "${WMII_DIR}/rbar/${id}.${n}"
+ done
+ sleep 1
+done
diff --git a/.config/wmii-hg/rbar_battery b/.config/wmii-hg/rbar_battery
deleted file mode 100755
index f632f7e..0000000
--- a/.config/wmii-hg/rbar_battery
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-. include.sh
-
-priority=$1
-
-while connected_to_x_server; do
- printf 'label %s\n' "$(acpi -b)" >> "$WMII_DIR/rbar/${priority}_battery"
- sleep 1
-done
diff --git a/.config/wmii-hg/rbar_clock b/.config/wmii-hg/rbar_clock
index 6aecb92..c1692da 100755
--- a/.config/wmii-hg/rbar_clock
+++ b/.config/wmii-hg/rbar_clock
@@ -1,9 +1,13 @@
#!/bin/bash
. include.sh
-priority=$1
+id=$1
+trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT
while connected_to_x_server; do
- printf 'label %s\n' "$(date)" >> "$WMII_DIR/rbar/${priority}_clock"
+ {
+ printf 'label '
+ date +'%a, %F %T %Z(%:::z)'
+ } |sponge >> "${WMII_DIR}/rbar/${id}"
sleep .5
done
diff --git a/.config/wmii-hg/rbar_cpu b/.config/wmii-hg/rbar_cpu
deleted file mode 100755
index 5531e60..0000000
--- a/.config/wmii-hg/rbar_cpu
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-. include.sh
-
-priority=$1
-
-while connected_to_x_server; do
- # This doesn't work for me, it shows capacity
- #echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') >> "$WMII_DIR/rbar/${priority}_cpu"
- # This actually displays %idle
- echo 'label CPU: [ '$(tail -n3 ~/tmp/cputime|sed -ur 's/\s\s+/\t/g'|cut -f2,11|sed 's/\t\(.*\)/(\1)/')' ]' >> "$WMII_DIR/rbar/${priority}_cpu"
- sleep 1
-done
diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi
index 18395a3..53464dc 100755
--- a/.config/wmii-hg/rbar_wifi
+++ b/.config/wmii-hg/rbar_wifi
@@ -1,9 +1,22 @@
#!/bin/bash
. include.sh
-priority=$1
+id=$1
+trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT
+
+iwinfo() {
+ interface=$1
+ iwconfig "$interface" |
+ sed -r 's/ {2,}/\n/g' |
+ sed -e '/^\s*$/d' -e 's/:\s*/=/' \
+ -e '1s/^/Interface=/' \
+ -e '2s/^/MAC Protocol=/'
+}
while connected_to_x_server; do
- echo 'label Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) >> "$WMII_DIR/rbar/${priority}_wifi"
+ {
+ printf 'label '
+ iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /'
+ } | sponge >> "${WMII_DIR}/rbar/${id}"
sleep 1
done