added wifi script
authorMart Lubbers <mart@martlubbers.net>
Fri, 26 Feb 2016 10:04:12 +0000 (11:04 +0100)
committerMart Lubbers <mart@martlubbers.net>
Fri, 26 Feb 2016 10:04:12 +0000 (11:04 +0100)
cal/.config/khal/khal.conf
shell/.bashrc
x/.config/i3/config
x/.local/bin/network
x/.local/bin/wifi [new file with mode: 0755]

index 9f3745e..e945b99 100644 (file)
@@ -31,3 +31,4 @@ firstweekday = 0
 default_command = calendar
 default_calendar = mart
 show_all_days = True
+editor = system
index 0d6e71f..e199fb4 100644 (file)
@@ -15,7 +15,7 @@ export PAGER=less
 export SUDO_ASKPASS=/usr/lib/ssh/ssh-askpass
 export NOTMUCH_CONFIG=/home/mart/.mutt/notmuch-config
 
-export CLEAN_HOME=~/projects/clean
+export CLEAN_HOME=~/projects/clean-itasks
 export PATH=$PATH:$CLEAN_HOME/lib/exe:$CLEAN_HOME/bin:~/.local/bin
 
 alias ls='ls --color=auto'
index 06ef691..479c40c 100644 (file)
@@ -28,6 +28,7 @@ bindsym $mod+l exec xautolock -locknow
 # put a password in the clipboard
 bindsym $mod+y exec passmenu
 bindsym $mod+b exec ~/.local/bin/network
+bindsym $mod+Shift+b exec ~/.local/bin/wifi
 
 # font for window titles.
 font pango:$font 8
index a1cf48a..905ff44 100755 (executable)
@@ -1,3 +1,2 @@
 #!/bin/bash
-network="$(netctl list | cut -b 3- | dmenu)"
-[[ $network != "" ]] && sudo -A netctl switch-to "$network" || true
+netctl list | cut -b 3- | dmenu | ifne xargs sudo -A netctl switch-to
diff --git a/x/.local/bin/wifi b/x/.local/bin/wifi
new file mode 100755 (executable)
index 0000000..f024272
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+{ 
+       sudo -A iw dev wlp2s0 scan | grep -Po "(?<=SSID: ).*" | sort -u;
+       netctl list | cut -b 3-; 
+} | sort | uniq -d | head -1 | ifne xargs sudo -A netctl switch-to