From dd748573b261181f94d47ef7c0bf3e116d07409f Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Date: Tue, 11 Jun 2019 09:30:56 +0200 Subject: Improved status bar --- scripts/dwm-status | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'scripts/dwm-status') diff --git a/scripts/dwm-status b/scripts/dwm-status index 02aca75..2715c1d 100755 --- a/scripts/dwm-status +++ b/scripts/dwm-status @@ -13,7 +13,8 @@ delim="|" # explained. status() { \ - echo $(python /home/baitinq/.config/polybar/scripts/weather.py) + # Directs to the path of the weather script. + echo $(python $( cd "$(dirname "$0")" ; pwd -P )/weather.py) echo "$delim" @@ -50,16 +51,18 @@ status() { \ for x in /sys/class/power_supply/BAT?/capacity; do case "$(cat $x)" in - 100|9[0-9]) echo "" ;; - 8[0-9]|7[0-9]) echo "" ;; - 6[0-9]|5[0-9]) echo "" ;; - 4[0-9]|3[0-9]) echo "" ;; - *) echo "" ;; + 100) echo "" ;; + 9[0-9]) echo " $(cat $x)%" ;; + 8[0-9]|7[0-9]) echo " $(cat $x)%" ;; + 6[0-9]|5[0-9]) echo " $(cat $x)%" ;; + 4[0-9]|3[0-9]) echo " $(cat $x)%" ;; + 2[0-9]|1[0-9]) echo " $(cat $x)%" ;; + [0-9]) echo " $(cat $x)%" ;; esac done && echo "$delim" # Date and time. FORMAT CORRECT NO PM - echo " $(date '+%Y %b %d (%a) %I:%M%p')" + echo " $(date '+%d-%m-%y (%a) |  %H:%M')" } while :; do -- cgit 1.4.1