diff options
| -rwxr-xr-x | .config/bspwm/bspwmrc | 3 | ||||
| -rwxr-xr-x | .local/bin/tsarbar_status.sh | 20 |
2 files changed, 12 insertions, 11 deletions
diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 6827e52..17b5cef 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -5,10 +5,11 @@ xbanish & thunderbird & dunst & tsarbar & +sleep 1 tsarbar_status.sh & feh --bg-scale ~/media/img/bbwp10x.png & -bspc monitor -d WWW DEV GAME MISC +bspc monitor -d www dev game misc bspc config border_width 1 bspc config window_gap 0 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 |
