scripts

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

commit 628bfc0e81744364628866f72a7d5aa8bf5fc5eb
parent 91fe360c8197aff2448b04b01cee7d596eca7fcf
Author: Willy Goiffon <w.goiffon@gmail.com>
Date:   Sat Aug  3 03:18:04 +0200

added mails + ratpoison groups

Diffstat:
bar/config.sh | 1+
bar/status.sh | 36+++++++++++++++++++++++++++++++++++-
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/bar/config.sh b/bar/config.sh @@ -60,6 +60,7 @@ i_grap='GPU' i_fans='FAN' i_musk='CUR' i_alsa='VOL' +i_mail='MSG' i_time="$(date '+%d %b')" # clock # workspace icons / names (α β γ δ ε ζ η θ ι κ λ) diff --git a/bar/status.sh b/bar/status.sh @@ -31,6 +31,39 @@ function workspaces () { echo -n "${buffer}" } +function ratgrp() { + dskp_tag=('' 'MEH' 'WEB' 'DEV') + dskp_cur=$(ratpoison -c 'groups' | cut -sd'*' -f1) + dskp_num=$(ratpoison -c 'groups'| wc -l) + + val="" + + for w in $(seq 1 $dskp_num); do + if [ "$w" -eq "$dskp_cur" ]; then + val="$val\u${fg} ${dskp_tag[$w]} \u${bg}" + else + val="$val ${dskp_tag[$w]} " + fi + done + + echo -n "${val}" +} + +function groups() { + if [ "$(xprop -root _NET_WM_NAME|cut -d\" -f2)" = "ratpoison" ]; then + echo "$(ratgrp)" + else + echo "$(workspaces)" + fi +} + +function mails () { + val=$(~/bin/mailcount) + ico=${i_mail} + + display "$val" "$ico" +} + function mpd_now_playing () { val=$(mpc current --format "$mpc_format" 2>/dev/null) [[ $? -ne 0 ]] && val="-stopped-" @@ -138,9 +171,10 @@ function fillbar () { buffer="$buffer$(volume) ${sp}" buffer="$buffer$(mpd_now_playing) " buffer="$buffer\c\u${bg}" - buffer="$buffer$(workspaces) " + buffer="$buffer$(groups) " buffer="$buffer\r\u${bg}" # buffer="$buffer$(network) ${sp}" + buffer="$buffer$(mails) ${sp}" buffer="$buffer$(memory) ${sp}" buffer="$buffer$(processes) ${sp}" buffer="$buffer$(gputemp) ${sp}"