can use to disable wifi when ethernet connected and enable
wifi when ethernet disconnected
runs /etc/ifplugd/ifplugd.action on up/down with
two arguments: name of ethernet interface and whether it went
up or down. Shell script inspired by
this link:
#!/bin/sh
# disable wifi if ethernet connected and enable wifi if ethernet disconnected
case $2 in
up) # ethernet up means wifi down
iwctl station wlan0 disconnect
;;
down) # ethernet down means wifi up
# parse `iwctl known-networks list` and connect to most recent network
iwctl station wlan0 connect "$(/home/stephenhuan/bin/iwd-last-network)"
;;
esac