From e92af1f7088cc5b6b40a5ceba275a197c305de62 Mon Sep 17 00:00:00 2001 From: katherine Date: Sat, 19 Mar 2016 22:17:28 -0700 Subject: snapshot lots of random things changed; forgot to update for a while again. moving things to .config/init/funcs is one important thing; means being able to use those shell scripts anywhere, like ranger or whatever --- .config/herbstluftwm/panel.sh | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to '.config/herbstluftwm/panel.sh') diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh index 4b7c1a0..78f7d7b 100755 --- a/.config/herbstluftwm/panel.sh +++ b/.config/herbstluftwm/panel.sh @@ -4,7 +4,6 @@ # SETUP # ########### -hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;} monitor=${1:-0} geometry=( $(herbstclient monitor_rect "$monitor") ) if [ -z "$geometry" ] ;then @@ -67,9 +66,10 @@ update_taglist() { -e '$d' \ -e 's/\(.*\)/\1 /' \ -e 's/:/ /' \ - -e "s/[#+\-%]\(.*\)/%{B${bg_focus} F${fg_focus}} \1%{B${bg_normal} F${fg_normal}}/" \ - -e "s/!\(.*\)/%{B${bg_urgent} F${fg_urgent}} \1%{B${bg_normal} F${fg_normal}}/" \ - -e "s/\.\(.*\)/%{B${bg_normal} F${light_black}} \1%{B${bg_normal} F${fg_normal}}/" \ + -e "s/^[-%]\(.*\)/%{B${light_black} F${fg_normal}} \1%{B${bg_normal} F${fg_normal}}/" \ + -e "s/^[#+]\(.*\)/%{B${bg_focus} F${fg_focus}} \1%{B${bg_normal} F${fg_normal}}/" \ + -e "s/^!\(.*\)/%{B${bg_urgent} F${fg_urgent}} \1%{B${bg_normal} F${fg_normal}}/" \ + -e "s/^\.\(.*\)/%{B${bg_normal} F${light_black}} \1%{B${bg_normal} F${fg_normal}}/" \ | tr -d '\n' echo "$sep" } @@ -96,7 +96,13 @@ update_winlist() { else echo -n "%{B${bg_normal} F${fg_normal}} " fi - echo -n "${line[@]:3}" | sed -r 's/(.{40}).*/\1\.\.\./' + { + if [[ -z "${line[@]:3}" ]]; then + echo -n "(has no name)" + else + echo -n "${line[@]:3}" + fi + } | sed -r 's/(.{40})...*/\1\.\.\./' echo -n " " done echo -n "%{B${bg_normal} F${fg_normal}}" @@ -198,13 +204,9 @@ event_when() { { event_tick & - echo -e "child\t$!" event_stats & - echo -e "child\t$!" event_when & - echo -e "child\t$!" event_mpd & - echo -e "child\t$!" hc --idle } 2> /dev/null | { @@ -280,15 +282,8 @@ event_when() { fields[2]=$(update_winlist) ;; - # append children to kill list - child) - child[((${#child[@]}+1))]=event[1] - ;; - quit_panel|reload) - for id in ${child[@]}; do - kill $id - done + kill -- -$$ exit ;; -- cgit v1.2.3