diff options
| author | iamcheeseman <[email protected]> | 2026-03-04 09:25:23 -0500 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-03-04 09:25:23 -0500 |
| commit | dea74983f6d1581c782b0caa21009fd8474295ec (patch) | |
| tree | 31cb4b1014f0733214b820cab13b83d42976efd2 /.local/bin/tsarbar_status.sh | |
| parent | b2438a079a3977f605630f0476220c83a1602611 (diff) | |
lowercase :)
Diffstat (limited to '.local/bin/tsarbar_status.sh')
| -rwxr-xr-x | .local/bin/tsarbar_status.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/.local/bin/tsarbar_status.sh b/.local/bin/tsarbar_status.sh index 413db5e..ec18150 100755 --- a/.local/bin/tsarbar_status.sh +++ b/.local/bin/tsarbar_status.sh @@ -25,8 +25,6 @@ tsarc layout \ -center window \ -right ram ~ vol ~ clock -trap "pkill -P $$" INT - workspace() { focused_ws=`bspc query -D --names -d focused` ws=`bspc query -D --names | tr '\n' ' '` @@ -34,16 +32,18 @@ workspace() { rws=`echo $ws | awk -F$focused_ws '{print $2}'` tsarc set lwkspace -text " $lws" tsarc set cwkspace -text "$focused_ws" - tsarc set rwkspace -text "$rws " + tsarc set rwkspace -text "$rws" } window_name() { win_id=$(bspc query -N -n focused) if [[ -n "$win_id" ]]; then - title=$(xtitle $win_id) - tsarc set window -text "$title" + title=`xtitle $win_id \ + | awk 'length > 64{$0=substr($0,0,64)"..."}1' \ + | tr '[:upper:]' '[:lower:]'` + tsarc set window -text "$title" -fg "#000000" -bg "#FFFFFF" else - tsarc set window -text "[...]" + tsarc set window -text "no window focused" -fg "#CCCCCC" -bg "#404040" fi } @@ -54,7 +54,7 @@ done & volume() { tsarc set vol -text \ - "VOL `pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "%s", $5}'`" + "vol `pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "%s", $5}'`" } volume @@ -75,13 +75,13 @@ playerctl -F metadata -f "{{lc(status)}} {{lc(title)}} - {{lc(artist)}}" \ esac case "$status" in "playing") tsarc set player -text \ - "`echo $line | awk 'match($0, $1) {print substr($0, RSTART+RLENGTH)}'`" + "`echo $line | awk 'match($0, $1) {print substr($0, RSTART+RLENGTH)}' | xargs`" esac done & while true; do - tsarc set ram -text "RAM `free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2}'`" - 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" | tr '[:upper:]' '[:lower:]'` " window_name sleep 1 done |
