diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-06-11 09:48:46 +0200 |
---|---|---|
committer | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-06-11 09:48:46 +0200 |
commit | d8e9b376605de1a79b6d039f874b746dfc9319aa (patch) | |
tree | 2538fdb4430c710704f265243e90c505a5dc763b | |
parent | Improved status bar (diff) | |
download | dwm-d8e9b376605de1a79b6d039f874b746dfc9319aa.tar.gz dwm-d8e9b376605de1a79b6d039f874b746dfc9319aa.tar.bz2 dwm-d8e9b376605de1a79b6d039f874b746dfc9319aa.zip |
Improved status bar
-rwxr-xr-x | scripts/dwm-status | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/dwm-status b/scripts/dwm-status index 2715c1d..2a07e8b 100755 --- a/scripts/dwm-status +++ b/scripts/dwm-status @@ -7,17 +7,57 @@ delim="|" +updates() { + + if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then + updates_arch=0 + fi + + # if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then + if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then + updates_aur=0 + fi + + updates=$(("$updates_arch" + "$updates_aur")) + + if [ "$updates" -gt 0 ]; then + echo " Updates: $updates" + else + echo "0" + fi + +} + +tor() { + + icon_enabled="ﴣ" + icon_disabled="" + status=`systemctl is-active tor.service` + + if [ $status == "active" ] + then + echo "$delim $icon_enabled $delim" + else + echo "$icon_disabled" + fi +} # Here is the (big) function that outputs the appearance of the statusbar. It # can really be broken down into many submodules which I've commented and # explained. status() { \ + echo $(tor) + # Directs to the path of the weather script. echo $(python $( cd "$(dirname "$0")" ; pwd -P )/weather.py) echo "$delim" + echo $(updates) + + echo "$delim" + # Get the volume of ALSA's master volume output. Show an icon if or # not muted. active_sink=$(pacmd list-sinks | awk '/* index:/{print $3}') |