From d4f134015e7a51177e78b31c97403ec8a549363d Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 20 Apr 2017 16:20:09 +1200 Subject: Add UPS capability and XAU to dwm bar --- local/bin/update-dwm-bar | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'local/bin') 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 -- cgit v1.1