diff options
Diffstat (limited to '.local/bin/tsarbar_status.sh')
| -rwxr-xr-x | .local/bin/tsarbar_status.sh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/.local/bin/tsarbar_status.sh b/.local/bin/tsarbar_status.sh index cd65726..413db5e 100755 --- a/.local/bin/tsarbar_status.sh +++ b/.local/bin/tsarbar_status.sh @@ -1,7 +1,7 @@ #! /bin/bash tsarc config -font "CommitMono:pixelsize=15" -tsarc config -height 17 +tsarc config -height 20 tsarc config -bg "#101010" tsarc config -gap 10 @@ -47,22 +47,22 @@ window_name() { fi } -bspc subscribe \ - desktop_focus desktop_add desktop_remove \ - node_focus node_add node_remove node_transfer \ +bspc subscribe desktop_focus desktop_add desktop_remove \ | while read -r _; do workspace - window_name done & -tsarc set vol -text \ - "VOL `pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "%s", $5}'`" +volume() { + tsarc set vol -text \ + "VOL `pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "%s", $5}'`" +} + +volume pactl subscribe \ | while read -r line; do case "$line" in *"Event 'change' on sink #"*|*"Event 'change' on source #"*) - tsarc set vol -text \ - "VOL `pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "%s", $5}'`" + volume while read -t 0.01 -r _; do :; done esac done & @@ -80,7 +80,8 @@ playerctl -F metadata -f "{{lc(status)}} {{lc(title)}} - {{lc(artist)}}" \ done & while true; do - tsarc set clock -text "`date +"%a %b %d, %r"` " tsarc set ram -text "RAM `free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2}'`" + tsarc set clock -text "`date +"%a %b %d, %r"` " + window_name sleep 1 done |
