summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-01-31 14:39:53 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-02-02 12:50:49 -0500
commit98b992702f05cf652ec9417d10e248ed9de1ce80 (patch)
treeeef74a9e5314624e116c0ef00e49a66c1f7972fd /.config
parentb17bbf2b8efc093b27f5db13b80b01558d8a486b (diff)
wmii: rbar_wifi: add more options
Diffstat (limited to '.config')
-rwxr-xr-x.config/wmii-hg/rbar_wifi26
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"