From 21a61fb639e8434fff924f3b862ebd8014f02c60 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sun, 5 Mar 2017 15:31:23 +1300 Subject: Tidy dwm bar when missing elements, fix battery --- local/bin/update-dwm-bar | 8 ++++---- 1 file 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 -- cgit v1.1