diff --git a/skel/.i3/run.sh b/skel/.i3/run.sh index f727148..2aa9dbe 100755 --- a/skel/.i3/run.sh +++ b/skel/.i3/run.sh @@ -175,10 +175,16 @@ if [ "$ARG" = "clip" ]; then fi fi if [ "$ARG" = "ssh_helper" ]; then - if command -v iwgetid >/dev/null; then + if [ -f /proc/net/wireless ]; then + WIRELESS_DEV="$(perl -ne 'print if s/(\w+):.*/\1/' /dev/null; then SSID="$(iwgetid wlan0 -r)" elif command -v nmcli >/dev/null; then SSID="$(nmcli -t -f active,ssid dev wifi | perl -ne 'print if s/yes://;')" + elif command -v termux-wifi-connectioninfo >/dev/null; then + # Android device (termux) + SSID="$(termux-wifi-connectioninfo | perl -ne 'print if s/^\s*"ssid": "(.+)",$/\1/')" fi case "$(hostname)" in sgen|egen|runner2) @@ -188,10 +194,12 @@ if [ "$ARG" = "ssh_helper" ]; then logger "Found SSID for $(hostname): $SSID" case "$SSID" in ATTskUYuI2) - ssh -q -W "${1}" "${2}@192.168.1.200" + logger "ssh -q -W ${1} 192.168.1.200" + ssh -q -W "${1}" 192.168.1.200 ;; *) - ssh -q -W "${1}" -p 23 "${2}@austenwares.com" + logger "ssh -q -W ${1} -p 23 austenwares.com" + ssh -q -W "${1}" -p 23 austenwares.com ;; esac fi