diff options
Diffstat (limited to '.config/wmii-hg')
-rwxr-xr-x | .config/wmii-hg/rbar_wifi | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi index 63dc653..195df7c 100755 --- a/.config/wmii-hg/rbar_wifi +++ b/.config/wmii-hg/rbar_wifi @@ -29,7 +29,7 @@ right-click() { IFS='' while read -r line; do list+=("$line") - done < <(netctl-auto list | sed 's,$,$,' | column -s '$' -t) + done < <({ netctl-auto list; printf '> %s\n' 'New Network' 'Disable All' 'Enable All';} | sed 's,$,$,' | column -s '$' -t) cur='' for item in "${list[@]}"; do @@ -39,9 +39,27 @@ right-click() { done item=$(wmii9menu -i "$cur" "${list[@]}") - if [[ -n $item ]] && [[ "$item" != '* '* ]]; then - netctl-auto switch-to "$item" - fi + case "$item" in + '') + # Nothing selected + ;; + '* '*) + # Already selected; do nothing + ;; + '> New Network'*) + urxvt +sb -title wifi-menu -e sudo wifi-menu + ;; + '> Disable All'*) + sudo netctl-auto disable-all + ;; + '> Enable All'*) + sudo netctl-auto enable-all + ;; + *) + # NB: do NOT quote $item; we need to strip whitespace + sudo netctl-auto switch-to $item + ;; + esac } . "$(dirname "$0")/rbar.sh" |