Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bin/ethernet.ui.profile.start
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh

wifi.any.stop
wifi.stop
sudo /usr/bin/systemctl start dhcpcd
8 changes: 1 addition & 7 deletions .bin/is.wifi.auto.running
Original file line number Diff line number Diff line change
@@ -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
7 changes: 1 addition & 6 deletions .bin/is.wifi.profile.running
Original file line number Diff line number Diff line change
@@ -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
9 changes: 2 additions & 7 deletions .bin/is.wifi.running
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .bin/wifi
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

sudo /usr/bin/wifi-menu "$@"
iwctl "$@"
10 changes: 2 additions & 8 deletions .bin/wifi.any.stop
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions .bin/wifi.auto.start
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions .bin/wifi.auto.stop
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .bin/wifi.profile.start
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

sudo /usr/bin/netctl start "$1"
iwctl station "$(wifi.chips.default)" connect "$1"
2 changes: 1 addition & 1 deletion .bin/wifi.profile.stop
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

sudo /usr/bin/netctl stop "$1"
wifi.any.stop
2 changes: 1 addition & 1 deletion .bin/wifi.profiles
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion .bin/wifi.profiles.running
Original file line number Diff line number Diff line change
@@ -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}'
4 changes: 1 addition & 3 deletions .bin/wifi.resume
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions .bin/wifi.start
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh

ethernet.ui.profile.stop
sudo /usr/bin/systemctl start iwd
3 changes: 3 additions & 0 deletions .bin/wifi.stations
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

iwctl station list | tail +5 | head -1 | sed -e 's/^ *//' -e 's/ */ /g'
9 changes: 3 additions & 6 deletions .bin/wifi.status
Original file line number Diff line number Diff line change
@@ -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-[mw]l' ; 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
3 changes: 3 additions & 0 deletions .bin/wifi.stop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

sudo /usr/bin/systemctl stop iwd
4 changes: 1 addition & 3 deletions .bin/wifi.suspend
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
7 changes: 2 additions & 5 deletions .bin/wifi.ui.profile.start
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env sh

profiles=$(wifi.profiles | cut -b3-)
profile="$(
echo "$profiles" | \
dmenu_center -p '' -sb '#85bd85' -sf '#333' -i -z -no-custom -fullscreen
)"
profiles=$(wifi.profiles)
profile=$(echo "$profiles" | dmenu_center --rest -z -p '' -sb '#85bd85' -i -t -l 10)

if [ "$profile" != '' ] ; then
ethernet.ui.profile.stop
Expand Down
4 changes: 4 additions & 0 deletions .config/i3/config
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ mode "wifi" {
bindcode 40 exec wifi.ui.profile.stop; mode "default"
#-- bindsym c exec wifi.ui.profile.start; mode "default"
bindcode 54 exec wifi.ui.profile.start; mode "default"
#-- bindsym Shift+S exec wifi.stop; mode "default"
bindcode Shift+39 exec wifi.stop; mode "default"
#-- bindsym s exec wifi.start; mode "default"
bindcode 39 exec wifi.start; mode "default"

#-- bindsym x exec menu.netctl.status; mode "default"
bindcode 53 exec menu.netctl.status; mode "default"
Expand Down