summaryrefslogtreecommitdiff
path: root/.wmii
diff options
context:
space:
mode:
Diffstat (limited to '.wmii')
-rw-r--r--.wmii/include.sh5
-rwxr-xr-x.wmii/rbar_battery3
-rwxr-xr-x.wmii/rbar_clock3
-rwxr-xr-x.wmii/rbar_cpu3
-rwxr-xr-x.wmii/rbar_wifi3
5 files changed, 9 insertions, 8 deletions
diff --git a/.wmii/include.sh b/.wmii/include.sh
index 36f8f3e..f4b29b3 100644
--- a/.wmii/include.sh
+++ b/.wmii/include.sh
@@ -68,3 +68,8 @@ Action() {
return 1
fi
}
+
+connected_to_x_server() {
+ xdpyinfo &>/dev/null
+ return $?
+}
diff --git a/.wmii/rbar_battery b/.wmii/rbar_battery
index 7a7f24f..0e70799 100755
--- a/.wmii/rbar_battery
+++ b/.wmii/rbar_battery
@@ -3,8 +3,7 @@
priority=$1
-set -e
-while true; do
+while connected_to_x_server; do
acpi -b |a "$WMII_DIR/rbar/${priority}_battery"
sleep 1
done
diff --git a/.wmii/rbar_clock b/.wmii/rbar_clock
index 8e7d2a4..86bf14d 100755
--- a/.wmii/rbar_clock
+++ b/.wmii/rbar_clock
@@ -3,8 +3,7 @@
priority=$1
-set -e
-while true; do
+while connected_to_x_server; do
date |a "$WMII_DIR/rbar/${priority}_clock"
sleep .5
done
diff --git a/.wmii/rbar_cpu b/.wmii/rbar_cpu
index 7f891da..d3bdd88 100755
--- a/.wmii/rbar_cpu
+++ b/.wmii/rbar_cpu
@@ -3,8 +3,7 @@
priority=$1
-set -e
-while true; do
+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;') |a "$WMII_DIR/rbar/${priority}_cpu"
# This actually displays %idle
diff --git a/.wmii/rbar_wifi b/.wmii/rbar_wifi
index 608b164..2ea84a3 100755
--- a/.wmii/rbar_wifi
+++ b/.wmii/rbar_wifi
@@ -3,8 +3,7 @@
priority=$1
-set -e
-while true; do
+while connected_to_x_server; do
echo 'Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) |a "$WMII_DIR/rbar/${priority}_wifi"
sleep 1
done