#!/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