Skip to content

Commit c62891d

Browse files
🚧 progress: First draft.
1 parent 6b161b8 commit c62891d

15 files changed

+25
-51
lines changed

.bin/is.wifi.auto.running

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
#!/usr/bin/env dash
2-
# shellcheck disable=SC2009
3-
ps -u root -o command | grep -q '[n]etctl/auto.action$'
4-
#interface="$(wifi.chips.default)"
5-
#systemctl | \
6-
#grep 'netctl-auto@'"$interface" | \
7-
#grep -e 'loaded\s*active\s*\(exited\|running\)' | \
8-
#grep -o 'netctl-auto@.*\.service' 1>&2
2+
is.wifi.running

.bin/is.wifi.profile.running

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
#!/usr/bin/env sh
22

3-
interface="$(wifi.chips.default)"
4-
5-
systemctl |
6-
grep 'netctl@'"$interface" |
7-
grep -e 'loaded\s*active\s*\(exited\|running\)' |
8-
grep -o 'netctl@.*\.service' 1>&2
3+
exit 1

.bin/is.wifi.running

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
#!/usr/bin/env dash
2-
# shellcheck disable=SC2009
3-
ps -u root -o command | grep -q '[r]un/netctl/wpa_supplicant-wlp'
4-
#interface="$(wifi.chips.default)"
5-
#systemctl | \
6-
#grep 'netctl\(\|-auto\)@'"$interface" | \
7-
#grep -e 'loaded\s*active\s*\(exited\|running\)' | \
8-
#grep -o 'netctl\(\|-auto\)@.*\.service' 1>/dev/null
2+
#ps -u root -o command | grep -q '^/usr/lib/iwd/iwd$'
3+
systemctl is-active iwd > /dev/null

.bin/wifi.any.stop

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
#!/usr/bin/env sh
22

3-
profile="$(wifi.profiles.running)"
3+
chip="$(wifi.chips.default)"
44

5-
if [ "$profile" != '' ] ; then
6-
wifi.profile.stop "$profile"
7-
elif is.wifi.auto.running ; then
8-
wifi.auto.stop
9-
fi
10-
11-
sudo /usr/bin/ip link set "$(wifi.chips.default)" down
5+
iwctl station "$chip" disconnect

.bin/wifi.auto.start

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
#!/usr/bin/env sh
22

3-
interface="$(wifi.chips.default)"
4-
5-
sudo /usr/bin/systemctl start 'netctl-auto@'"$interface"
3+
sudo /usr/bin/systemctl start iwd

.bin/wifi.auto.stop

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
#!/usr/bin/env sh
22

3-
interface="$(wifi.chips.default)"
4-
5-
sudo /usr/bin/systemctl stop 'netctl-auto@'"$interface"
3+
sudo /usr/bin/systemctl stop iwd

.bin/wifi.profile.start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env sh
22

3-
sudo /usr/bin/netctl start "$1"
3+
iwctl station "$(wifi.chips.default)" connect "$1"

.bin/wifi.profile.stop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env sh
22

3-
sudo /usr/bin/netctl stop "$1"
3+
wifi.any.stop

.bin/wifi.profiles

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env sh
22

3-
netctl list
3+
iwctl known-networks list | tail +5 | grep '^ [^ ]' | sed -e 's/^\s*//g' -e 's/\s*$//g' -e 's/\s\s*/ /g' | cut -d' ' -f1

.bin/wifi.profiles.running

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
#!/usr/bin/env sh
22

3-
wifi.profiles | grep '^\*' | sed 's/^\*\s*//'
3+
#interface="$(wifi.chips.default)"
4+
5+
#iwctl station "$interface" show |
6+
#grep 'Connected network' |
7+
#awk '{print $3}'

0 commit comments

Comments
 (0)