Last active
December 1, 2020 03:27
-
-
Save salkin-mada/6a47d226e4990869ac1b369dbc4a186a to your computer and use it in GitHub Desktop.
skim iwctl func
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wif() { | |
local device=$(iwctl device list | awk '{print $1}' | rg w) | |
echo "using device: $device" | |
local cmd="iwctl station $device get-networks" | |
local pcmd="iwctl station $device show" | |
echo "scanning for networks" | |
iwctl station $device scan && iwctl station $device connect \ | |
$(sk --ansi -c $cmd --preview $pcmd \ | |
--bind 'enter:execute(echo {} | awk '"'"'{print $1}'"'"')+abort' \ | |
--bind 'esc:execute(echo "user_closed_wif")+abort' \ | |
--bind 'ctrl-c:execute(echo "user_closed_wif")+abort' | |
) | |
} | |
# for hidden AP's | |
function wifh() { | |
local device=$(iwctl device list | awk '{print $1}' | rg w) | |
echo "using device: $device" | |
local cmd="iwctl station $device get-hidden-access-points" | |
local pcmd="iwctl station $device show" | |
echo "scanning for networks" | |
iwctl station $device scan && iwctl station $device connect-hidden \ | |
$(sk --ansi -c $cmd --preview $pcmd \ | |
--bind 'enter:execute(echo {} | awk '"'"'{print $1}'"'"')+abort' \ | |
--bind 'esc:execute(echo "user_closed_wif")+abort' \ | |
--bind 'ctrl-c:execute(echo "user_closed_wif")+abort' | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment