diff options
author | David Phillips <david@sighup.nz> | 2017-04-20 18:03:53 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-04-20 18:03:53 +1200 |
commit | f8f974f175f964a6f147e72299a1898c50bfce50 (patch) | |
tree | 2c0a95c2372d1adb58ba77ee0d989fc5fa27a019 /local/bin/update-dwm-bar | |
parent | 61ddee05adf0934cd5e723f9941d39e15070cbac (diff) | |
download | dotfiles-f8f974f175f964a6f147e72299a1898c50bfce50.tar.xz |
Make currency more extensible
Diffstat (limited to 'local/bin/update-dwm-bar')
-rwxr-xr-x | local/bin/update-dwm-bar | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/local/bin/update-dwm-bar b/local/bin/update-dwm-bar index ac68582..bde7aeb 100755 --- a/local/bin/update-dwm-bar +++ b/local/bin/update-dwm-bar @@ -7,8 +7,11 @@ while true; do if hash upsc 2>/dev/null; then ups="UPS: $(upsc eaton5e@zoidberg battery.charge)% $sep " fi - if [ -f ~/.cache/XAGNZD ]; then - xa="$(cat ~/.cache/XAGNZD) $(cat ~/.cache/XAUNZD) $sep " + if [ ! -z "$(ls -A ~/.cache/currency/)" ] ; then + for c in ~/.cache/currency/* ; do + currency="$currency$(cat $c) " + done + currency="$currency$sep " fi if [ -d "/sys/class/power_supply/BAT0/" ]; then bat="$(cat /sys/class/power_supply/BAT0/capacity)%" @@ -35,7 +38,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 "$xa$ups$thermal_string $sep $bat_string$datetime_string" || exit + xsetroot -name "$currency$ups$thermal_string $sep $bat_string$datetime_string" || exit sleep "$DELAY" done |