tAdded a function to return current group AND shown groups - scripts - various script and utils
 (HTM) git clone git://z3bra.org/scripts
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit 80ae7c2e0f7d6a30c732ce2d42ec41e010350735
 (DIR) parent cbaecede0900106f1e1158fa6cd638bbcf4a4390
 (HTM) Author: z3bra <willy@mailoo.org>
       Date:   Fri, 23 May 2014 10:53:01 +0200
       
       Added a function to return current group AND shown groups
       
       Diffstat:
         M mkbar                               |      30 ++++++++++++++++++++++++++++--
       
       1 file changed, 28 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/mkbar b/mkbar
       t@@ -17,6 +17,7 @@ barfg='%{F#ffffffff}'
        barbg='%{F#00333333}'
        
        grpfg='%{F#fffff000} '
       +grpmg='%{F#ff666666} '
        grpbg='%{F#00ffffff} '
        
        # no need to modify anything else here
       t@@ -113,6 +114,31 @@ groups() {
            echo $line
        }
        
       +# print current group and shown groups
       +wgroup() {
       +    cur=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}'`
       +    tot=`xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{print $3}'`
       +
       +    for wid in `xprop -root | sed '/_LIST(WINDOW)/!d;s/.*# //;s/,//g'`; do
       +        if grep -q 'IsViewable' <<< $(xwininfo -id $wid); then
       +            grp=`xprop -id $wid _NET_WM_DESKTOP | awk '{print $3}'`
       +            shown="$shown $grp"
       +        fi
       +    done
       +
       +    for g in `seq 0 $((tot - 1))`; do
       +        if test $g -eq $cur; then
       +            line="${line}${grpfg}"
       +        elif grep -q $g <<< "$shown"; then
       +            line="${line}${grpmg}"
       +        else
       +            line="${line}${grpbg}"
       +        fi
       +    done
       +
       +    echo $line
       +}
       +
        nowplaying() {
            cur=`mpc current`
            # this line allow to choose whether the output will scroll or not
       t@@ -129,7 +155,7 @@ makebar() {
            for v in $(seq 0 $((max - 1))); do
                if [ "$v" -lt "$cur" ]; then
                    bar="${bar}${barfg}${barch}"
       -         else
       +        else
                    bar="${bar}${barbg}${barch}"
                fi
            done
       t@@ -153,7 +179,7 @@ buf="$buf $(netstate) "
        
        buf="${buf}%{F#ffcef318} %{F-} $(nettrafic down) "
        buf="${buf}%{F#ffd43f10} %{F-} $(nettrafic up) "
       -buf="${buf}%{c} $(groups)"
       +buf="${buf}%{c} $(wgroup)"
        buf="${buf}%{r}"
        buf="${buf}%{F#ffede265} %{F-} $(mails) "