summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-04-20 16:20:09 +1200
committerDavid Phillips <david@sighup.nz>2017-04-20 16:20:09 +1200
commitd4f134015e7a51177e78b31c97403ec8a549363d (patch)
tree2a85fa3ca13753c2f9a01fe1e17ef206aac28c82
parent4a235fbf650ac10fd1e3e2994e7c6cb2d043a2b7 (diff)
downloaddotfiles-d4f134015e7a51177e78b31c97403ec8a549363d.tar.xz
Add UPS capability and XAU to dwm bar
-rwxr-xr-xlocal/bin/update-dwm-bar7
1 files changed, 5 insertions, 2 deletions
diff --git a/local/bin/update-dwm-bar b/local/bin/update-dwm-bar
index 276b9e7..ac68582 100755
--- a/local/bin/update-dwm-bar
+++ b/local/bin/update-dwm-bar
@@ -4,8 +4,11 @@ DELAY=20
sep=$(echo -e '\u2502')
while true; do
+ if hash upsc 2>/dev/null; then
+ ups="UPS: $(upsc eaton5e@zoidberg battery.charge)% $sep "
+ fi
if [ -f ~/.cache/XAGNZD ]; then
- xag="$(cat ~/.cache/XAGNZD) $sep "
+ xa="$(cat ~/.cache/XAGNZD) $(cat ~/.cache/XAUNZD) $sep "
fi
if [ -d "/sys/class/power_supply/BAT0/" ]; then
bat="$(cat /sys/class/power_supply/BAT0/capacity)%"
@@ -32,7 +35,7 @@ while true; do
done
thermal_string="${thermal_string%,} °C"
datetime_string=$(date "+%A $sep %d %h %Y $sep %_I:%M %p (UTC%:::z)")
- xsetroot -name "$xag$thermal_string $sep $bat_string$datetime_string" || exit
+ xsetroot -name "$xa$ups$thermal_string $sep $bat_string$datetime_string" || exit
sleep "$DELAY"
done