diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-12-02 15:11:07 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-12-02 15:11:07 +0100 |
commit | 9b672254e9b46977b8cb8f2342916ece1eeb696c (patch) | |
tree | 3e1dc41cd98cb6b3d136dc1e4d07ad0dbd2f58e0 | |
parent | 25e9dd1aab70f47d119958b117485973bd653e70 (diff) | |
download | dotfiles-9b672254e9b46977b8cb8f2342916ece1eeb696c.tar.gz dotfiles-9b672254e9b46977b8cb8f2342916ece1eeb696c.tar.bz2 dotfiles-9b672254e9b46977b8cb8f2342916ece1eeb696c.zip |
Fixed (kinda) long window names looking ugly in the bar
-rwxr-xr-x | mybar/mybar.awk | 12 | ||||
-rwxr-xr-x | mybar/mybar.sh | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/mybar/mybar.awk b/mybar/mybar.awk index 44fbc58..3d5db1d 100755 --- a/mybar/mybar.awk +++ b/mybar/mybar.awk @@ -10,12 +10,17 @@ BEGIN { redshift="" wifi="" + isnotebook=0 + cpu_pused=0 cpu_ptotal=0 } $1 == "date" { date = $2 " " $3 " " $4 } +$1 == "isnotebook" { + isnotebook = 1 +} $1 == "cpu" { used=$2+$3+$4+$7+$8; total=used+$5+$6; @@ -135,6 +140,11 @@ $1 == "wifi" { } } { - print "\\l" wminfo "\\c" window "\\r" wifi " " battery " " mem " " cpu " " redshift "R\\ur " date " " + if(isnotebook && (length(window) > 70)) { + window2 = " " window + } else { + window2 = "\\c" window + } + print "\\l" wminfo window2 "\\r" wifi " " battery " " mem " " cpu " " redshift "R\\ur " date " " fflush() } diff --git a/mybar/mybar.sh b/mybar/mybar.sh index 5adc11e..c0380b5 100755 --- a/mybar/mybar.sh +++ b/mybar/mybar.sh @@ -56,6 +56,7 @@ update_cpu > "$BAR_FIFO" & if test $(hostname) = "kch42-notebook"; then update_bat > "$BAR_FIFO" & update_wifi > "$BAR_FIFO" & + echo "isnotebook" > "$BAR_FIFO" & fi xtitle -sf 'window %s' > "$BAR_FIFO" & |