scripts

various script and utils
git clone git://z3bra.org/scripts
Log | Files | Refs

commit ceeaf811397f91c0707117f389deb4e9cf755e02
parent 905b528b6dc7a586978776b5bb76f56c5d14e6d3
Author: Willy Goiffon <w.goiffon@gmail.com>
Date:   Tue Sep 24 13:07:16 +0200

Updated bar + fixed the new behavior

Diffstat:
bar/config.sh | 35+++++++++++++++--------------------
bar/status.sh | 25+++++++++++++------------
2 files changed, 28 insertions(+), 32 deletions(-)
diff --git a/bar/config.sh b/bar/config.sh @@ -1,31 +1,26 @@ #!/bin/bash # Color used in the bar (extracted from .Xresources) -# * 0 : beige (background) -# * 1 : brown (foreground) -# * 2 : black -# * 3 : red -# * 4 : green -# * 5 : yellow -# * 6 : blue -# * 7 : magenta -# * 8 : cyan -# * 9 : white +# * 0 : black +# * 1 : red +# * 2 : green +# * 3 : yellow +# * 4 : blue +# * 5 : magenta +# * 6 : cyan +# * 7 : white # unified colors bg="0" -fg="1" -hl="2" -dk="3" +fg="9" +hl="8" +dk="1" # separator -sp="\f${dk}$(echo -e '\ue190')\fr " - -# delimiter (between icon and value) -dl=" " +sp=" " # path to executable -bar="/usr/bin/bar -b" +bar="/usr/bin/bar -f" # pipe to feed the bar fifo=/tmp/bar.fifo @@ -58,10 +53,10 @@ i_load='CPU' i_memy='RAM' i_grap='GPU' i_fans='FAN' -i_musk='CUR' +i_musk='MPD' i_alsa='VOL' i_mail='MSG' -i_time="$(date '+%d %b')" # clock +i_time="$(date '+%d/%m')" # clock # workspace icons / names (α β γ δ ε ζ η θ ι κ λ) # i_trm=$(echo -e '\ue09f') # default diff --git a/bar/status.sh b/bar/status.sh @@ -5,7 +5,7 @@ source $(dirname $0)/config.sh # print formatted output. need 2 params: display <value> <icon> function display () { echo -n "\f${hl}" - echo -ne "$2" + echo -ne "$2 " echo "${dl}\f${fg}$1" } @@ -20,11 +20,13 @@ function workspaces () { buffer="" - for w in $(seq 0 $dskp_num); do + for w in $(seq 1 $(($dskp_num-1))); do if [ "$w" -eq "$dskp_cur" ]; then - buffer="$buffer\u${fg} ${dskp_tag[$w]} \u${bg}" + buffer="$buffer $(echo -e '\ue190') " + #buffer="$buffer\u${fg} ${dskp_tag[$w]} \u${bg}" else - buffer="$buffer ${dskp_tag[$w]} " + buffer="$buffer \f${hl}$(echo -e '\ue190')\fr " + #buffer="$buffer ${dskp_tag[$w]} " fi done @@ -66,7 +68,7 @@ function mails () { function mpd_now_playing () { val=$(mpc current --format "$mpc_format" 2>/dev/null) - [[ $? -ne 0 ]] && val="-stopped-" + [[ -z $val ]] && val="mute" ico=${i_musk} display "$val" "$ico" @@ -166,20 +168,19 @@ function clock () { } function fillbar () { - buffer="\b${bg}\f${fg}" - buffer="$buffer\l\u${bg} " + buffer="\b${bg}\f${fg}\l\u${bg} " buffer="$buffer$(volume) ${sp}" buffer="$buffer$(mpd_now_playing) " - buffer="$buffer\c\u${bg}" + buffer="$buffer\c" buffer="$buffer$(groups) " - buffer="$buffer\r\u${bg}" + buffer="$buffer\r" # buffer="$buffer$(network) ${sp}" buffer="$buffer$(mails) ${sp}" buffer="$buffer$(memory) ${sp}" - buffer="$buffer$(processes) ${sp}" - buffer="$buffer$(gputemp) ${sp}" + #buffer="$buffer$(processes) ${sp}" + #buffer="$buffer$(gputemp) ${sp}" buffer="$buffer$(gpufanspeed) ${sp}" - buffer="$buffer$(packages) ${sp}" + #buffer="$buffer$(packages) ${sp}" buffer="$buffer$(clock)" buffer="$buffer " echo "$buffer"