diff options
author | David Phillips <david@sighup.nz> | 2017-03-05 15:31:23 +1300 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-03-05 15:31:23 +1300 |
commit | 21a61fb639e8434fff924f3b862ebd8014f02c60 (patch) | |
tree | c57ce684fe8b05cbc6e0f6654c41e18b4bd6877e | |
parent | 34f5226e6b79f11ad3deccbab01d8255377462e8 (diff) | |
download | dotfiles-21a61fb639e8434fff924f3b862ebd8014f02c60.tar.xz |
Tidy dwm bar when missing elements, fix battery
-rwxr-xr-x | local/bin/update-dwm-bar | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/local/bin/update-dwm-bar b/local/bin/update-dwm-bar index 34a283f..276b9e7 100755 --- a/local/bin/update-dwm-bar +++ b/local/bin/update-dwm-bar @@ -1,13 +1,13 @@ -#!/bin/sh +#!/bin/bash DELAY=20 sep=$(echo -e '\u2502') while true; do if [ -f ~/.cache/XAGNZD ]; then - xag="$(cat ~/.cache/XAGNZD) $sep" + xag="$(cat ~/.cache/XAGNZD) $sep " fi - if [ -d /sys/class/power_suppply/BAT0/ ]; then + if [ -d "/sys/class/power_supply/BAT0/" ]; then bat="$(cat /sys/class/power_supply/BAT0/capacity)%" case "$(cat /sys/class/power_supply/BAT0/status)" in Full) @@ -32,7 +32,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 "$xag$thermal_string $sep $bat_string$datetime_string" || exit sleep "$DELAY" done |