From 0c48704753e2ce6d127a151c0d53f017fa6c1f5d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 12 Oct 2013 19:25:20 -0400 Subject: fix a few remaining merge conflicts --- .config/wmii-hg/autostart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/autostart b/.config/wmii-hg/autostart index 9c47a9d..db097e1 100755 --- a/.config/wmii-hg/autostart +++ b/.config/wmii-hg/autostart @@ -1,12 +1,12 @@ #!/bin/bash . include.sh -daemon xcompmgr &> /dev/null -daemon lxpanel &> /dev/null -daemon nm-applet &> /dev/null -daemon dunst &> /dev/null +daemon xcompmgr &> /dev/null +daemon lxpanel &> /dev/null +#daemon nm-applet &> /dev/null +daemon dunst &> /dev/null +daemon blueman-applet &> /dev/null +#daemon linphone --iconified &> /dev/null -#Action rbar_cpu 01 & -#Action rbar_wifi 97 & -#Action rbar_battery 98 & -Action rbar_clock 99 & +Action rbar_cpu 01 & +Action rbar_clock 99 & -- cgit v1.2.3-2-g168b From e93048c125c728d61613d76eab938da9bf7f41c4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 26 Apr 2014 13:55:03 -0400 Subject: start clipit for X11 --- .config/wmii-hg/autostart | 1 + 1 file changed, 1 insertion(+) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/autostart b/.config/wmii-hg/autostart index db097e1..ed37f33 100755 --- a/.config/wmii-hg/autostart +++ b/.config/wmii-hg/autostart @@ -7,6 +7,7 @@ daemon lxpanel &> /dev/null daemon dunst &> /dev/null daemon blueman-applet &> /dev/null #daemon linphone --iconified &> /dev/null +dameon clipit -dn &> /dev/null Action rbar_cpu 01 & Action rbar_clock 99 & -- cgit v1.2.3-2-g168b From 79603171010f907ef037213b7ec6cbf5f33258c1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 10 Jul 2014 18:05:37 -0400 Subject: stuff --- .config/wmii-hg/autostart | 6 ++++-- .config/wmii-hg/wmiirc | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/autostart b/.config/wmii-hg/autostart index f5e5419..cee702a 100755 --- a/.config/wmii-hg/autostart +++ b/.config/wmii-hg/autostart @@ -1,12 +1,14 @@ #!/bin/bash . include.sh +xrandr --output VGA-1 --off + daemon xcompmgr &> /dev/null daemon lxpanel &> /dev/null #daemon nm-applet &> /dev/null daemon dunst &> /dev/null daemon blueman-applet &> /dev/null -dameon clipit -dn &> /dev/null +daemon clipit -dn &> /dev/null -Action rbar_cpu 01 & +#Action rbar_cpu 01 & Action rbar_clock 99 & diff --git a/.config/wmii-hg/wmiirc b/.config/wmii-hg/wmiirc index a6bc4b4..a7dd80c 100755 --- a/.config/wmii-hg/wmiirc +++ b/.config/wmii-hg/wmiirc @@ -1,4 +1,7 @@ #!/bin/bash +unset WMII_NAMESPACE +unset WMII_DIR + export _PATH="$PATH" export PATH="$WMII_CONFPATH:$PATH" -- cgit v1.2.3-2-g168b From e72554e8e5bf453109b31d0797323fd7085b169c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 10 Oct 2014 17:13:06 -0400 Subject: clean up wmii config --- .config/wmii-hg/config.sh | 12 +++++------- .config/wmii-hg/util.sh | 31 +++++++++++-------------------- 2 files changed, 16 insertions(+), 27 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 3ddc8d5..3b1b20f 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -163,9 +163,8 @@ Event() { RightMouseDND) ## $1=button $2=bar_item Event RightBarClick "$@";; esac -} ## End Event +} -# Key Bindings Key() { key=$1 case "$key" in @@ -237,14 +236,13 @@ Key() { echo "$tag" >> $WMII_DIR/client/$sel/tags }& ;; esac -} ## End Key +} Action() { - prog=`path_which "$WMII_CONFPATH" $1`; shift + prog=$(path_which "$WMII_CONFPATH" "$1"); shift if [ -n "$prog" ]; then "$prog" "$@" - return $? else - return 1 + false fi -} ## End Action +} diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh index 71dbc41..f15031e 100644 --- a/.config/wmii-hg/util.sh +++ b/.config/wmii-hg/util.sh @@ -35,7 +35,6 @@ is_mounted() { local dir="$(readlink -m $1)" local mntpnt="$(cut -d' ' -f2 /proc/mounts|grep -Fx -- "$dir")" [[ $dir = "$mntpnt" ]] - return $? } ################################################################################ @@ -85,7 +84,6 @@ lstags() { ## connected_to_x_server() { xdpyinfo &>/dev/null - return $? } ################################################################################ @@ -93,32 +91,25 @@ connected_to_x_server() { ################################################################################ ## -# Usage: scansection [SECTION] +# Usage: scansection SECTION # Reads the doc comments from a section of wmiirc. -# If SECTION is not given, it reads all doc comments. ## scansection() { - local file=$(conffile config.sh) local sec=$1 - local tmp=$(mktemp --tmpdir wmii-scansecion.XXXXXXXXXX) - # Isolate the sections we want. - if [ -n "$sec" ]; then - # Find the section - < "$file" sed -n "/^\s*$sec\s*()/,/##\s*End $sec/p" | sed '1d;$d'> "$tmp" - else - # Remove extra lines that mark the end of a section - < "$file" sed "/\s*}\s*##\s*End\s/d" > "$tmp" - fi - < "$tmp" sed -n '/##/p' | while read; do - var="$(echo "$REPLY" | sed -nr 's/^\s*(.*)\)\s*##.*/\1/p')" - comment="$(echo "$REPLY" | sed -r 's/.*## ?//')" - if [ -z "$var" ]; then + + local file=$(conffile config.sh) + # Isolate the section we want. + < "$file" sed -n "/^\s*$sec\s*()/,/^}/{ /##/p }" | + # Parse each line. + while read -r line; do + symbol="$(sed -nr 's/^\s*(.*)\)\s*##.*/\1/p' <<<"$line")" + comment="$(sed -r 's/.*## ?//' <<<"$line")" + if [ -z "$symbol" ]; then printf '%s\n' "$comment" else - printf '\t%s\t%s\n' "$(echo "$var"|expand_variables)" "$comment" + printf '\t%s\t%s\n' "$(expand_variables <<<"$symbol")" "$comment" fi done - rm -- "$tmp" } ## -- cgit v1.2.3-2-g168b From 480d42ba2f7339a1c992e035f0ad90fcac416346 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 10 Oct 2014 17:13:58 -0400 Subject: wmii: make fltk windows be floating --- .config/wmii-hg/rules | 2 ++ 1 file changed, 2 insertions(+) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/rules b/.config/wmii-hg/rules index cf735c9..3576983 100644 --- a/.config/wmii-hg/rules +++ b/.config/wmii-hg/rules @@ -4,5 +4,7 @@ /nm-applet/ floating=off +/^FLTK:FLTK:/ floating=always + /Emacs|Navigator/ force-tags=+sel floating=never /.*/ floating=off -- cgit v1.2.3-2-g168b From a12f3189bcf6d2cf277acfa7824961b158bd57e6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 29 Nov 2014 22:38:56 -0500 Subject: stuff --- .config/wmii-hg/config.sh | 20 ++++++++++---------- .config/wmii-hg/util.sh | 2 +- .config/wmii-hg/wmiirc | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 3b1b20f..c560f3f 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -7,7 +7,7 @@ LEFT=b RIGHT=f HIST="$XDG_CACHE_HOME/wmii/history" -mkdir -p "${HIST%/*}" +mkdir -p -- "${HIST%/*}" # Colors tuples: " " . theme-tango-dark @@ -43,12 +43,12 @@ Event() { find $WMII_DIR/{l,r}bar -type f -delete # Populate the LBar by emulating [Create|Focus]Tag events seltag=`sed 1q $WMII_DIR/tag/sel/ctl` - lstags | while read tag; do + while read -r tag; do Event CreateTag "$tag" if [ "$tag" = "$seltag" ]; then Event FocusTag "$tag" fi - done + done < <(lstags) # Run the autostart action Action autostart 2>/dev/null & @@ -138,13 +138,13 @@ Event() { DestroyTag) ## $1=tag rm $WMII_DIR/lbar/$1;; FocusTag) ## $1=tag - echo colors "$WMII_FOCUSCOLORS" >> $WMII_DIR/lbar/$1;; + echo colors "$WMII_FOCUSCOLORS" >> $WMII_DIR/lbar/$1;; UnfocusTag) ## $1=tag - echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; + echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; UrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_URGENTCOLORS" >> $WMII_DIR/lbar/$1;; + echo colors "$WMII_URGENTCOLORS" >> $WMII_DIR/lbar/$1;; NotUrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; + echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; ## LeftBar events (usually tag buttons) LeftBarMouseDown) ## $1=button $2=bar_item @@ -219,15 +219,15 @@ Key() { $MODKEY-a) ## Open wmii actions menu Action $(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000) & ;; $MODKEY-x) ## Open program menu - PATH=$_PATH setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000) & ;; + (PATH=$_PATH exec setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)) & ;; $MODKEY-Return) ## Launch a terminal - PATH=$_PATH setsid x-terminal-emulator & ;; + (PATH=$_PATH exec setsid x-terminal-emulator) & ;; ## Tag actions $MODKEY-t) ## Change to another tag { tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo view $tag >> $WMII_DIR/ctl + echo view $tag >> $WMII_DIR/ctl }& ;; $MODKEY-Shift-t) ## Retag the selected client sel=$(sed 1q $WMII_DIR/client/sel/ctl) diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh index f15031e..2211d28 100644 --- a/.config/wmii-hg/util.sh +++ b/.config/wmii-hg/util.sh @@ -71,7 +71,7 @@ path_which() { # Lists wmii tags ## lstags() { - ls "$WMII_DIR/tag" | sed -e 's@/$@@' -e '/^sel$/d' + ls "$WMII_DIR/tag" | sed -e 's,/$,,' -e '/^sel$/d' } ################################################################################ diff --git a/.config/wmii-hg/wmiirc b/.config/wmii-hg/wmiirc index a7dd80c..a6585de 100755 --- a/.config/wmii-hg/wmiirc +++ b/.config/wmii-hg/wmiirc @@ -13,6 +13,6 @@ Event WmiircStart trap "Event Quit" EXIT -wmiir read /event 2>/dev/null | while read event; do +while read -r event; do Event $event -done +done < <(wmiir read /event 2>/dev/null) -- cgit v1.2.3-2-g168b From 10fe774027ba3b5230809a142a499802f977360b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:17:14 -0500 Subject: wmii: mark local variables as local --- .config/wmii-hg/config.sh | 19 ++++++++++--------- .config/wmii-hg/util.sh | 9 +++++---- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index c560f3f..437c585 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -13,7 +13,7 @@ mkdir -p -- "${HIST%/*}" . theme-tango-dark Event() { - event=$1; shift; + local event=$1; shift; case "$event" in ## Mouse event meanings: ## MouseDown = mouse down @@ -42,7 +42,7 @@ Event() { # Clear the LBar and RBar find $WMII_DIR/{l,r}bar -type f -delete # Populate the LBar by emulating [Create|Focus]Tag events - seltag=`sed 1q $WMII_DIR/tag/sel/ctl` + local tag seltag="$(sed 1q $WMII_DIR/tag/sel/ctl)" while read -r tag; do Event CreateTag "$tag" if [ "$tag" = "$seltag" ]; then @@ -99,14 +99,14 @@ Event() { NotUrgent) ## $1=client $2=[Manager|Client] ;; ClientMouseDown) ## $1=client $2=button - client=$1 - button=$2 + local client=$1 + local button=$2 case $button in 1) ;; 2) ;; 3) { - case `wmii9menu Delete Fullscreen` in + case $(wmii9menu Delete Fullscreen) in Delete) echo kill >> $WMII_DIR/client/$client/ctl;; Fullscreen) @@ -117,8 +117,9 @@ Event() { ClientClick) ## $1=client $2=button ;; Unresponsive) ## $1=client - client=$1 - client_name=`cat $WMII_DIR/client/$client/label` + local client=$1 + local client_name=$(< $WMII_DIR/client/$client/label) + local msg resp msg="The client \`${client_name}' is not responding." msg+=" What would you like to do?" { @@ -166,7 +167,7 @@ Event() { } Key() { - key=$1 + local key=$1 case "$key" in ## Moving around @@ -239,7 +240,7 @@ Key() { } Action() { - prog=$(path_which "$WMII_CONFPATH" "$1"); shift + local prog=$(path_which "$WMII_CONFPATH" "$1"); shift if [ -n "$prog" ]; then "$prog" "$@" else diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh index 2211d28..323d8a6 100644 --- a/.config/wmii-hg/util.sh +++ b/.config/wmii-hg/util.sh @@ -25,11 +25,12 @@ dquote() { # Usage: expand_variables # Expands variables read from /dev/stdin ## -expand_variables() { - while read; do - eval printf "'%s\n'" "$(dquote "$REPLY")" +expand_variables() ( + IFS='' + while read -r line; do + eval printf "'%s\n'" "$(dquote "$line")" done -} +) is_mounted() { local dir="$(readlink -m $1)" -- cgit v1.2.3-2-g168b From d7128cd444fce3129a78e08fe643978fb25c3846 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:17:44 -0500 Subject: wmii: think harder about when to fork --- .config/wmii-hg/config.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 437c585..f7ea3f7 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -51,7 +51,7 @@ Event() { done < <(lstags) # Run the autostart action - Action autostart 2>/dev/null & + Action autostart ;; WmiircQuit) ## No args echo ' ==> Stopping wmiirc' @@ -218,24 +218,22 @@ Key() { ## Running programs $MODKEY-a) ## Open wmii actions menu - Action $(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000) & ;; + local action="$(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000)" + Action "$action" & ;; $MODKEY-x) ## Open program menu - (PATH=$_PATH exec setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)) & ;; + local command="$(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)" || return + ( PATH=$_PATH exec setsid $command ) & ;; $MODKEY-Return) ## Launch a terminal - (PATH=$_PATH exec setsid x-terminal-emulator) & ;; + ( PATH=$_PATH exec setsid x-terminal-emulator ) & ;; ## Tag actions $MODKEY-t) ## Change to another tag - { - tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo view $tag >> $WMII_DIR/ctl - }& ;; + local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + echo view "$tag" >> $WMII_DIR/ctl;; $MODKEY-Shift-t) ## Retag the selected client - sel=$(sed 1q $WMII_DIR/client/sel/ctl) - { - tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo "$tag" >> $WMII_DIR/client/$sel/tags - }& ;; + local sel=$(sed 1q $WMII_DIR/client/sel/ctl) + local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + echo "$tag" >> $WMII_DIR/client/$sel/tags;; esac } -- cgit v1.2.3-2-g168b From 87428a01acb77a94d35c03264d376a2ee3853664 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:18:31 -0500 Subject: wmii: re-jigger the rbar --- .config/wmii-hg/autostart | 6 ++++-- .config/wmii-hg/rbar_acpi | 15 +++++++++++++++ .config/wmii-hg/rbar_battery | 9 --------- .config/wmii-hg/rbar_clock | 8 ++++++-- .config/wmii-hg/rbar_cpu | 12 ------------ .config/wmii-hg/rbar_wifi | 17 +++++++++++++++-- 6 files changed, 40 insertions(+), 27 deletions(-) create mode 100755 .config/wmii-hg/rbar_acpi delete mode 100755 .config/wmii-hg/rbar_battery delete mode 100755 .config/wmii-hg/rbar_cpu (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/autostart b/.config/wmii-hg/autostart index cee702a..156fe7d 100755 --- a/.config/wmii-hg/autostart +++ b/.config/wmii-hg/autostart @@ -10,5 +10,7 @@ daemon dunst &> /dev/null daemon blueman-applet &> /dev/null daemon clipit -dn &> /dev/null -#Action rbar_cpu 01 & -Action rbar_clock 99 & +PATH="$WMII_CONFPATH:$PATH" +daemon rbar_acpi 97_acpi &> /dev/null +daemon rbar_wifi 98_wifi &> /dev/null +daemon rbar_clock 99_clock &> /dev/null diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi new file mode 100755 index 0000000..1771875 --- /dev/null +++ b/.config/wmii-hg/rbar_acpi @@ -0,0 +1,15 @@ +#!/bin/bash +. include.sh + +id=$1 +trap "rm -f ${WMII_DIR}/rbar/${id}.*" EXIT + +while connected_to_x_server; do + acpi -bt | sed -r \ + -e 's/^([A-Z])[a-z]+ ([0-9]+):/\1\2:/' \ + -e 's/\s*degrees\s*/°/g' | + cat -n | while read -r n line; do + printf "label %s\n" "$line" >> "${WMII_DIR}/rbar/${id}.${n}" + done + sleep 1 +done diff --git a/.config/wmii-hg/rbar_battery b/.config/wmii-hg/rbar_battery deleted file mode 100755 index f632f7e..0000000 --- a/.config/wmii-hg/rbar_battery +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -. include.sh - -priority=$1 - -while connected_to_x_server; do - printf 'label %s\n' "$(acpi -b)" >> "$WMII_DIR/rbar/${priority}_battery" - sleep 1 -done diff --git a/.config/wmii-hg/rbar_clock b/.config/wmii-hg/rbar_clock index 6aecb92..c1692da 100755 --- a/.config/wmii-hg/rbar_clock +++ b/.config/wmii-hg/rbar_clock @@ -1,9 +1,13 @@ #!/bin/bash . include.sh -priority=$1 +id=$1 +trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT while connected_to_x_server; do - printf 'label %s\n' "$(date)" >> "$WMII_DIR/rbar/${priority}_clock" + { + printf 'label ' + date +'%a, %F %T %Z(%:::z)' + } |sponge >> "${WMII_DIR}/rbar/${id}" sleep .5 done diff --git a/.config/wmii-hg/rbar_cpu b/.config/wmii-hg/rbar_cpu deleted file mode 100755 index 5531e60..0000000 --- a/.config/wmii-hg/rbar_cpu +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -. include.sh - -priority=$1 - -while connected_to_x_server; do - # This doesn't work for me, it shows capacity - #echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') >> "$WMII_DIR/rbar/${priority}_cpu" - # This actually displays %idle - echo 'label CPU: [ '$(tail -n3 ~/tmp/cputime|sed -ur 's/\s\s+/\t/g'|cut -f2,11|sed 's/\t\(.*\)/(\1)/')' ]' >> "$WMII_DIR/rbar/${priority}_cpu" - sleep 1 -done diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi index 18395a3..53464dc 100755 --- a/.config/wmii-hg/rbar_wifi +++ b/.config/wmii-hg/rbar_wifi @@ -1,9 +1,22 @@ #!/bin/bash . include.sh -priority=$1 +id=$1 +trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT + +iwinfo() { + interface=$1 + iwconfig "$interface" | + sed -r 's/ {2,}/\n/g' | + sed -e '/^\s*$/d' -e 's/:\s*/=/' \ + -e '1s/^/Interface=/' \ + -e '2s/^/MAC Protocol=/' +} while connected_to_x_server; do - echo 'label Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) >> "$WMII_DIR/rbar/${priority}_wifi" + { + printf 'label ' + iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /' + } | sponge >> "${WMII_DIR}/rbar/${id}" sleep 1 done -- cgit v1.2.3-2-g168b From 9316d6ee300ef980a38b7a3ba1da689065414795 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:20:36 -0500 Subject: wmii: {Not,}UrgentTag's arguments are actually flipped from the man page. --- .config/wmii-hg/config.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index f7ea3f7..888c3ae 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -142,10 +142,10 @@ Event() { echo colors "$WMII_FOCUSCOLORS" >> $WMII_DIR/lbar/$1;; UnfocusTag) ## $1=tag echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; - UrgentTag) ## $1=tag $2=[Manager|Client] - echo colors "$WMII_URGENTCOLORS" >> $WMII_DIR/lbar/$1;; - NotUrgentTag) ## $1=tag $2=[Manager|Client] - echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; + UrgentTag) ## $1=[Manager|Client] $2=tag + echo colors "$WMII_URGENTCOLORS" >> $WMII_DIR/lbar/$2;; + NotUrgentTag) ## $1=[Manager|Client] $2=tag + echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$2;; ## LeftBar events (usually tag buttons) LeftBarMouseDown) ## $1=button $2=bar_item -- cgit v1.2.3-2-g168b From a9935b7a12a522937d91cb44a0e138132b555e16 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:48:11 -0500 Subject: Re-jigger to use systemd for the process monitor for the window manager --- .config/wmii-hg/autostart | 16 ---------------- .config/wmii-hg/config.sh | 3 --- .config/wmii-hg/rbar | 9 +++++++++ 3 files changed, 9 insertions(+), 19 deletions(-) delete mode 100755 .config/wmii-hg/autostart create mode 100755 .config/wmii-hg/rbar (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/autostart b/.config/wmii-hg/autostart deleted file mode 100755 index 156fe7d..0000000 --- a/.config/wmii-hg/autostart +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -. include.sh - -xrandr --output VGA-1 --off - -daemon xcompmgr &> /dev/null -daemon lxpanel &> /dev/null -#daemon nm-applet &> /dev/null -daemon dunst &> /dev/null -daemon blueman-applet &> /dev/null -daemon clipit -dn &> /dev/null - -PATH="$WMII_CONFPATH:$PATH" -daemon rbar_acpi 97_acpi &> /dev/null -daemon rbar_wifi 98_wifi &> /dev/null -daemon rbar_clock 99_clock &> /dev/null diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 888c3ae..98c41a6 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -49,9 +49,6 @@ Event() { Event FocusTag "$tag" fi done < <(lstags) - - # Run the autostart action - Action autostart ;; WmiircQuit) ## No args echo ' ==> Stopping wmiirc' diff --git a/.config/wmii-hg/rbar b/.config/wmii-hg/rbar new file mode 100755 index 0000000..9aaa485 --- /dev/null +++ b/.config/wmii-hg/rbar @@ -0,0 +1,9 @@ +#!/bin/bash +IFS=: +read -r name prefix DISPLAY <<<"$1" +export DISPLAY + +id=$1 +name=${id#[0-9][0-9]_} + +exec "$0"_"$name" "${id}" -- cgit v1.2.3-2-g168b From 8396ed0fba3dc50d7f802dd1c6db282eb6fc73fa Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:51:20 -0500 Subject: wmii: 2 fixes - unset _PATH in child processes - local=$(FAILURE) succeeds; delcare local on a separate line. --- .config/wmii-hg/config.sh | 18 +++++++++++------- .config/wmii-hg/wmiirc | 6 ++++-- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 98c41a6..6f63f75 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -215,21 +215,25 @@ Key() { ## Running programs $MODKEY-a) ## Open wmii actions menu - local action="$(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000)" + local action + action="$(path_ls "$WMII_CONFPATH" | wimenu -h "${HIST}.actions" -n 5000)" || return Action "$action" & ;; $MODKEY-x) ## Open program menu - local command="$(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)" || return - ( PATH=$_PATH exec setsid $command ) & ;; + local command + command="$(path_ls "$_PATH" | wimenu -h "${HIST}.progs" -n 5000)" || return + ( PATH=$_PATH; unset _PATH; exec $command ) & ;; $MODKEY-Return) ## Launch a terminal - ( PATH=$_PATH exec setsid x-terminal-emulator ) & ;; + ( PATH=$_PATH; unset _PATH; exec x-terminal-emulator ) & ;; ## Tag actions $MODKEY-t) ## Change to another tag - local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + local tag + tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return echo view "$tag" >> $WMII_DIR/ctl;; $MODKEY-Shift-t) ## Retag the selected client - local sel=$(sed 1q $WMII_DIR/client/sel/ctl) - local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + local sel tag + sel=$(sed 1q $WMII_DIR/client/sel/ctl) + tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return echo "$tag" >> $WMII_DIR/client/$sel/tags;; esac } diff --git a/.config/wmii-hg/wmiirc b/.config/wmii-hg/wmiirc index a6585de..396bed2 100755 --- a/.config/wmii-hg/wmiirc +++ b/.config/wmii-hg/wmiirc @@ -2,8 +2,10 @@ unset WMII_NAMESPACE unset WMII_DIR -export _PATH="$PATH" -export PATH="$WMII_CONFPATH:$PATH" +if [[ -z $_PATH ]]; then + export _PATH="$PATH" + export PATH="$WMII_CONFPATH:$PATH" +fi . include.sh -- cgit v1.2.3-2-g168b From dd4773d812f379a3b562e1f873418edc2036d98c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:51:50 -0500 Subject: wmii: remove fixes.sh --- .config/wmii-hg/fixes.sh | 24 ------------------------ .config/wmii-hg/util.sh | 3 --- 2 files changed, 27 deletions(-) delete mode 100644 .config/wmii-hg/fixes.sh (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/fixes.sh b/.config/wmii-hg/fixes.sh deleted file mode 100644 index 5858859..0000000 --- a/.config/wmii-hg/fixes.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Fix various deficiencies in either the shell or the filesystem - -## -# Usage: ls DIRECTORY -# Linux's 9p kernel module sometimes omits entries in directory listings -## -unalias ls &>/dev/null -ls() { - local real_ls=("$(which ls)" -1F) - [ $# = 0 ] && set -- "$PWD" - f="${1/#${WMII_DIR}/}" - if [ "$f" = "$1" ]; then - "${real_ls[@]}" "$f" - else - wmiir ls "$f" - fi -} - -## -# Usage: setsid cmd [arguments...] -# I like wmiir's setsid better than linux-utils' -## -setsid() { wmiir setsid "$@"; } diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh index 323d8a6..b28a3b6 100644 --- a/.config/wmii-hg/util.sh +++ b/.config/wmii-hg/util.sh @@ -1,8 +1,5 @@ #!/bin/bash -# I moved "fixes" into a separate file because it isn't so much configuration... -. fixes.sh - ################################################################################ # Added shell features # ################################################################################ -- cgit v1.2.3-2-g168b From 8761e30b770ae0995dac884a04f2ac3818bcfc26 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:52:30 -0500 Subject: wmii: tidy up --- .config/wmii-hg/config.sh | 9 ++++----- .config/wmii-hg/theme-tango | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 6f63f75..d1da234 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -36,8 +36,7 @@ Event() { < "`conffile rules`" expand_variables >> $WMII_DIR/rules < "`conffile ctl-init`" expand_variables >> $WMII_DIR/ctl scansection Key | cut -sf2 >> $WMII_DIR/keys - # Configure X11 - hsetroot -solid "$WMII_BACKGROUND" + #hsetroot -solid "$WMII_BACKGROUND" # Clear the LBar and RBar find $WMII_DIR/{l,r}bar -type f -delete @@ -62,7 +61,7 @@ Event() { echo " -> Unmounting WMII_DIR=$WMII_DIR..." 9umount "$WMII_DIR" echo " -> Removing mountpoint WMII_DIR=$WMII_DIR..." - rmdir "$WMII_DIR";; + rmdir -p "$WMII_DIR" 2>/dev/null;; ## WMII-meta events Quit) ## No args echo ' ==> wmii quit: unmounting' @@ -241,8 +240,8 @@ Key() { Action() { local prog=$(path_which "$WMII_CONFPATH" "$1"); shift if [ -n "$prog" ]; then - "$prog" "$@" + exec "$prog" "$@" else - false + exec false fi } diff --git a/.config/wmii-hg/theme-tango b/.config/wmii-hg/theme-tango index e0e35d4..f4c20a2 100644 --- a/.config/wmii-hg/theme-tango +++ b/.config/wmii-hg/theme-tango @@ -7,4 +7,3 @@ TANGO_plum=( "#ad7fa8" "#75507b" "#5c3566") TANGO_red=( "#ef2929" "#cc0000" "#a40000") TANGO_alum=( "#eeeeec" "#d3d7cf" "#babdb6" "#888a85" "#555753" "#2e3436") - -- cgit v1.2.3-2-g168b From fd40e4ddaefc70acb2cedcbe69bce49077a62376 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:53:11 -0500 Subject: wmii: Make rbar way cooler --- .config/wmii-hg/config.sh | 6 +++++- .config/wmii-hg/rbar.sh | 18 +++++++++++++++++ .config/wmii-hg/rbar_acpi | 27 +++++++++++++------------ .config/wmii-hg/rbar_clock | 23 ++++++++++++---------- .config/wmii-hg/rbar_wifi | 49 ++++++++++++++++++++++++++++++++++------------ 5 files changed, 88 insertions(+), 35 deletions(-) create mode 100644 .config/wmii-hg/rbar.sh (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index d1da234..be75d65 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -154,7 +154,11 @@ Event() { ## RightBar events RightBarMouseDown) ## $1=button $2=bar_item - ;; + local button=$1 + local item=$2 + local name=${item#[0-9][0-9]_} + name=${name%.*} + Action "rbar_$name" "$button" & ;; RightBarClick) ## $1=button $2=bar_item ;; RightMouseDND) ## $1=button $2=bar_item diff --git a/.config/wmii-hg/rbar.sh b/.config/wmii-hg/rbar.sh new file mode 100644 index 0000000..8297b71 --- /dev/null +++ b/.config/wmii-hg/rbar.sh @@ -0,0 +1,18 @@ +#!/bin/bash +setup_trap() { + trap "rm -f -- ${HOME}/n/wmii*/rbar/${1}" EXIT +} + +write() { + dirs=("${HOME}"/n/wmii*/rbar/) + sponge|tee -a "${dirs[@]/%/${1}}" > /dev/null +} + +set -eE +shopt -s nullglob +case "$1" in + 1) left-click;; + 2) middle-click;; + 3) right-click;; + *) update "$1";; +esac diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi index 1771875..bdcdf0f 100755 --- a/.config/wmii-hg/rbar_acpi +++ b/.config/wmii-hg/rbar_acpi @@ -1,15 +1,18 @@ #!/bin/bash -. include.sh -id=$1 -trap "rm -f ${WMII_DIR}/rbar/${id}.*" EXIT +update() { + id=$1 + setup_trap "${id}.*" -while connected_to_x_server; do - acpi -bt | sed -r \ - -e 's/^([A-Z])[a-z]+ ([0-9]+):/\1\2:/' \ - -e 's/\s*degrees\s*/°/g' | - cat -n | while read -r n line; do - printf "label %s\n" "$line" >> "${WMII_DIR}/rbar/${id}.${n}" - done - sleep 1 -done + while true; do + acpi -bt | sed -r \ + -e 's/^([A-Z])[a-z]+ ([0-9]+):/\1\2:/' \ + -e 's/\s*degrees\s*/°/g' | + cat -n | while read -r n line; do + printf "label %s\n" "$line" | write "${id}.${n}" + done + sleep 1 + done +} + +. "$(dirname "$0")/rbar.sh" diff --git a/.config/wmii-hg/rbar_clock b/.config/wmii-hg/rbar_clock index c1692da..a09f016 100755 --- a/.config/wmii-hg/rbar_clock +++ b/.config/wmii-hg/rbar_clock @@ -1,13 +1,16 @@ #!/bin/bash -. include.sh -id=$1 -trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT +update() { + id=$1 + setup_trap "$id" -while connected_to_x_server; do - { - printf 'label ' - date +'%a, %F %T %Z(%:::z)' - } |sponge >> "${WMII_DIR}/rbar/${id}" - sleep .5 -done + while true; do + { + printf 'label ' + date +'%a, %F %T %Z(%:::z)' + } | write "$id" + sleep .5 + done +} + +. "$(dirname "$0")/rbar.sh" diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi index 53464dc..63dc653 100755 --- a/.config/wmii-hg/rbar_wifi +++ b/.config/wmii-hg/rbar_wifi @@ -1,11 +1,7 @@ #!/bin/bash -. include.sh - -id=$1 -trap "rm -f ${WMII_DIR}/rbar/${id}" EXIT iwinfo() { - interface=$1 + local interface=$1 iwconfig "$interface" | sed -r 's/ {2,}/\n/g' | sed -e '/^\s*$/d' -e 's/:\s*/=/' \ @@ -13,10 +9,39 @@ iwinfo() { -e '2s/^/MAC Protocol=/' } -while connected_to_x_server; do - { - printf 'label ' - iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /' - } | sponge >> "${WMII_DIR}/rbar/${id}" - sleep 1 -done +update() { + local id + id=$1 + setup_trap "$id" + while true; do + { + printf 'label ' + iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /' + } | write "$id" + sleep 1 + done +} + +right-click() { + local list cur item + + list=() + IFS='' + while read -r line; do + list+=("$line") + done < <(netctl-auto list | sed 's,$,$,' | column -s '$' -t) + + cur='' + for item in "${list[@]}"; do + if [[ "$item" = '* '* ]]; then + cur="$item" + fi + done + + item=$(wmii9menu -i "$cur" "${list[@]}") + if [[ -n $item ]] && [[ "$item" != '* '* ]]; then + netctl-auto switch-to "$item" + fi +} + +. "$(dirname "$0")/rbar.sh" -- cgit v1.2.3-2-g168b