From 597705ad735abef3def5a356f6e329eb2a978020 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Fri, 26 Feb 2016 11:04:12 +0100 Subject: [PATCH] added wifi script --- cal/.config/khal/khal.conf | 1 + shell/.bashrc | 2 +- x/.config/i3/config | 1 + x/.local/bin/network | 3 +-- x/.local/bin/wifi | 5 +++++ 5 files changed, 9 insertions(+), 3 deletions(-) create mode 100755 x/.local/bin/wifi diff --git a/cal/.config/khal/khal.conf b/cal/.config/khal/khal.conf index 9f3745e..e945b99 100644 --- a/cal/.config/khal/khal.conf +++ b/cal/.config/khal/khal.conf @@ -31,3 +31,4 @@ firstweekday = 0 default_command = calendar default_calendar = mart show_all_days = True +editor = system diff --git a/shell/.bashrc b/shell/.bashrc index 0d6e71f..e199fb4 100644 --- a/shell/.bashrc +++ b/shell/.bashrc @@ -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' diff --git a/x/.config/i3/config b/x/.config/i3/config index 06ef691..479c40c 100644 --- a/x/.config/i3/config +++ b/x/.config/i3/config @@ -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 diff --git a/x/.local/bin/network b/x/.local/bin/network index a1cf48a..905ff44 100755 --- a/x/.local/bin/network +++ b/x/.local/bin/network @@ -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 index 0000000..f024272 --- /dev/null +++ b/x/.local/bin/wifi @@ -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 -- 2.20.1