diff --git a/.bin/is.wifi.auto.running b/.bin/is.wifi.auto.running index 864e11a3..fb830a81 100755 --- a/.bin/is.wifi.auto.running +++ b/.bin/is.wifi.auto.running @@ -1,8 +1,2 @@ #!/usr/bin/env dash -# shellcheck disable=SC2009 -ps -u root -o command | grep -q '[n]etctl/auto.action$' -#interface="$(wifi.chips.default)" -#systemctl | \ -#grep 'netctl-auto@'"$interface" | \ -#grep -e 'loaded\s*active\s*\(exited\|running\)' | \ -#grep -o 'netctl-auto@.*\.service' 1>&2 +is.wifi.running diff --git a/.bin/is.wifi.profile.running b/.bin/is.wifi.profile.running index 2127baeb..d383672a 100755 --- a/.bin/is.wifi.profile.running +++ b/.bin/is.wifi.profile.running @@ -1,8 +1,3 @@ #!/usr/bin/env sh -interface="$(wifi.chips.default)" - -systemctl | -grep 'netctl@'"$interface" | -grep -e 'loaded\s*active\s*\(exited\|running\)' | -grep -o 'netctl@.*\.service' 1>&2 +exit 1 diff --git a/.bin/is.wifi.running b/.bin/is.wifi.running index e3a6c0e9..d6c8d35b 100755 --- a/.bin/is.wifi.running +++ b/.bin/is.wifi.running @@ -1,8 +1,3 @@ #!/usr/bin/env dash -# shellcheck disable=SC2009 -ps -u root -o command | grep -q '[r]un/netctl/wpa_supplicant-wlp' -#interface="$(wifi.chips.default)" -#systemctl | \ -#grep 'netctl\(\|-auto\)@'"$interface" | \ -#grep -e 'loaded\s*active\s*\(exited\|running\)' | \ -#grep -o 'netctl\(\|-auto\)@.*\.service' 1>/dev/null +#ps -u root -o command | grep -q '^/usr/lib/iwd/iwd$' +systemctl is-active iwd > /dev/null diff --git a/.bin/wifi.any.stop b/.bin/wifi.any.stop index b1f72a0a..7999cdb0 100755 --- a/.bin/wifi.any.stop +++ b/.bin/wifi.any.stop @@ -1,11 +1,5 @@ #!/usr/bin/env sh -profile="$(wifi.profiles.running)" +chip="$(wifi.chips.default)" -if [ "$profile" != '' ] ; then - wifi.profile.stop "$profile" -elif is.wifi.auto.running ; then - wifi.auto.stop -fi - -sudo /usr/bin/ip link set "$(wifi.chips.default)" down +iwctl station "$chip" disconnect diff --git a/.bin/wifi.auto.start b/.bin/wifi.auto.start index 4a282df9..db1edd92 100755 --- a/.bin/wifi.auto.start +++ b/.bin/wifi.auto.start @@ -1,5 +1,3 @@ #!/usr/bin/env sh -interface="$(wifi.chips.default)" - -sudo /usr/bin/systemctl start 'netctl-auto@'"$interface" +sudo /usr/bin/systemctl start iwd diff --git a/.bin/wifi.auto.stop b/.bin/wifi.auto.stop index 9188b17f..7950cdeb 100755 --- a/.bin/wifi.auto.stop +++ b/.bin/wifi.auto.stop @@ -1,5 +1,3 @@ #!/usr/bin/env sh -interface="$(wifi.chips.default)" - -sudo /usr/bin/systemctl stop 'netctl-auto@'"$interface" +sudo /usr/bin/systemctl stop iwd diff --git a/.bin/wifi.profile.start b/.bin/wifi.profile.start index bd132237..e3890af6 100755 --- a/.bin/wifi.profile.start +++ b/.bin/wifi.profile.start @@ -1,3 +1,3 @@ #!/usr/bin/env sh -sudo /usr/bin/netctl start "$1" +iwctl station "$(wifi.chips.default)" connect "$1" diff --git a/.bin/wifi.profile.stop b/.bin/wifi.profile.stop index 8d4a9b0e..9c5b95be 100755 --- a/.bin/wifi.profile.stop +++ b/.bin/wifi.profile.stop @@ -1,3 +1,3 @@ #!/usr/bin/env sh -sudo /usr/bin/netctl stop "$1" +wifi.any.stop diff --git a/.bin/wifi.profiles b/.bin/wifi.profiles index 38aac006..e3eae468 100755 --- a/.bin/wifi.profiles +++ b/.bin/wifi.profiles @@ -1,3 +1,3 @@ #!/usr/bin/env sh -netctl list +iwctl known-networks list | tail +5 | grep '^ [^ ]' | sed -e 's/^\s*//g' -e 's/\s*$//g' -e 's/\s\s*/ /g' | cut -d' ' -f1 diff --git a/.bin/wifi.profiles.running b/.bin/wifi.profiles.running index e8cbd05a..e4f43002 100755 --- a/.bin/wifi.profiles.running +++ b/.bin/wifi.profiles.running @@ -1,3 +1,7 @@ #!/usr/bin/env sh -wifi.profiles | grep '^\*' | sed 's/^\*\s*//' +#interface="$(wifi.chips.default)" + +#iwctl station "$interface" show | + #grep 'Connected network' | + #awk '{print $3}' diff --git a/.bin/wifi.resume b/.bin/wifi.resume index 925e0bfc..b6d932ec 100755 --- a/.bin/wifi.resume +++ b/.bin/wifi.resume @@ -1,10 +1,8 @@ #!/usr/bin/env sh -cache="${HOME}/.cache/netctl/last" +cache="${HOME}/.cache/iwctl/last" profile="$(cat "$cache")" -sudo /usr/bin/ip link set "$(wifi.chips.default)" down - if [ "$profile" = 'auto' ] ; then wifi.auto.start elif [ "$profile" != '' ] ; then diff --git a/.bin/wifi.stations b/.bin/wifi.stations new file mode 100755 index 00000000..e385eff3 --- /dev/null +++ b/.bin/wifi.stations @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +iwctl station list | tail +5 | head -1 | sed -e 's/^ *//' -e 's/ */ /g' diff --git a/.bin/wifi.status b/.bin/wifi.status index 3ade3229..b1f18efb 100755 --- a/.bin/wifi.status +++ b/.bin/wifi.status @@ -1,12 +1,9 @@ #!/usr/bin/env dash export MEMOIZE_CACHE="/tmp/${USER}-memoize" -if memoize 0 ps -u root -o command | grep -q '[r]un/netctl/wpa_supplicant-wlp' ; then - if memoize-get -1 ps -u root -o command | grep -q '[n]etctl/auto.action$' ; then - printf '%s\n' auto - else - printf '%s\n' profile - fi +if memoize 0 ps -u root -o command | grep -q '[/]usr/lib/iwd/iwd' ; then + printf '%s\n' profile + #printf '%s\n' enabled else printf '%s\n' disabled fi diff --git a/.bin/wifi.suspend b/.bin/wifi.suspend index 6378ace9..a5143e79 100755 --- a/.bin/wifi.suspend +++ b/.bin/wifi.suspend @@ -1,6 +1,6 @@ #!/usr/bin/env sh -cache="${HOME}/.cache/netctl/last" +cache="${HOME}/.cache/iwctl/last" profile="$(wifi.profiles.running)" if [ "$profile" != '' ] ; then @@ -14,5 +14,3 @@ elif is.wifi.auto.running ; then else rm -f "$cache" fi - -sudo /usr/bin/ip link set "$(wifi.chips.default)" down diff --git a/.bin/wifi.ui.profile.start b/.bin/wifi.ui.profile.start index f7033afe..d9f81a05 100755 --- a/.bin/wifi.ui.profile.start +++ b/.bin/wifi.ui.profile.start @@ -1,6 +1,6 @@ #!/usr/bin/env sh -profiles=$(wifi.profiles | cut -b3-) +profiles=$(wifi.profiles) profile=$(echo "$profiles" | dmenu_center --rest -z -p '' -sb '#85bd85' -i -t -l 10) if [ "$profile" != '' ] ; then