aboutsummaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/tsarbar_status.sh20
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