diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-06-11 08:39:29 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-06-11 08:39:29 +0200 |
| commit | 76c9d0aaa9bb734ad1ef32c1cd6a56461210010a (patch) | |
| tree | a25eeefdfaccd980ee82fb43c52f3b6737bc4ff6 /.xinitrc | |
| parent | 39fb7962ef35aa152d412322fd210be6ae462382 (diff) | |
| download | config-76c9d0aaa9bb734ad1ef32c1cd6a56461210010a.tar.gz config-76c9d0aaa9bb734ad1ef32c1cd6a56461210010a.zip | |
Better network management
Diffstat (limited to '.xinitrc')
| -rw-r--r-- | .xinitrc | 16 |
1 files changed, 11 insertions, 5 deletions
| @@ -1,3 +1,14 @@ | |||
| 1 | # Bring up ethernet and keep checking if available | ||
| 2 | doas ip link set eth1 up | ||
| 3 | while true; do | ||
| 4 | if [ "$(cat /sys/class/net/eth1/carrier)" = 1 ]; then | ||
| 5 | if ! doas ip -4 addr show eth1 | grep inet; then | ||
| 6 | doas udhcpc -i eth1 -n && iwctl station wlan0 disconnect | ||
| 7 | fi | ||
| 8 | fi | ||
| 9 | sleep 3 | ||
| 10 | done & | ||
| 11 | |||
| 1 | # Check every minute | 12 | # Check every minute |
| 2 | while true; do | 13 | while true; do |
| 3 | battery-checknow & | 14 | battery-checknow & |
| @@ -8,10 +19,6 @@ while true; do | |||
| 8 | done & | 19 | done & |
| 9 | sleep 0.01 & | 20 | sleep 0.01 & |
| 10 | 21 | ||
| 11 | if [ "$(cat /sys/class/net/eth0/carrier)" = 1 ]; then | ||
| 12 | iwctl station wlan0 disconnect | ||
| 13 | fi | ||
| 14 | |||
| 15 | xroot-update | 22 | xroot-update |
| 16 | 23 | ||
| 17 | sleep $((60 - $(date +%-S))) | 24 | sleep $((60 - $(date +%-S))) |
| @@ -36,4 +43,3 @@ xbanish & | |||
| 36 | Telegram & | 43 | Telegram & |
| 37 | #exec dwm | 44 | #exec dwm |
| 38 | exec dbus-launch --exit-with-session dwm | 45 | exec dbus-launch --exit-with-session dwm |
| 39 | rm .serverauth.* | ||
