summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.profile1
-rw-r--r--.xinitrc16
-rwxr-xr-xscripts/setup-config-alpine3
-rwxr-xr-xscripts/status-linux9
4 files changed, 15 insertions, 14 deletions
diff --git a/.profile b/.profile
index 6d38603..d9a7649 100644
--- a/.profile
+++ b/.profile
@@ -30,6 +30,7 @@ alias o='open-file'
30alias f='feed get && feed -m fzf menu' 30alias f='feed get && feed -m fzf menu'
31alias w='iwctl station wlan0 get-networks' 31alias w='iwctl station wlan0 get-networks'
32alias c='iwctl station wlan0 connect' 32alias c='iwctl station wlan0 connect'
33alias e='doas ip link set eth1 up && doas udhcpc -i eth1 -n'
33alias d='iwctl station wlan0 disconnect' 34alias d='iwctl station wlan0 disconnect'
34 35
35alias bc='bc -q /home/sebastiano/box/bc.library' 36alias bc='bc -q /home/sebastiano/box/bc.library'
diff --git a/.xinitrc b/.xinitrc
index 390bb20..f3be242 100644
--- a/.xinitrc
+++ b/.xinitrc
@@ -1,3 +1,14 @@
1# Bring up ethernet and keep checking if available
2doas ip link set eth1 up
3while 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
10done &
11
1# Check every minute 12# Check every minute
2while true; do 13while 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 &
36Telegram & 43Telegram &
37#exec dwm 44#exec dwm
38exec dbus-launch --exit-with-session dwm 45exec dbus-launch --exit-with-session dwm
39rm .serverauth.*
diff --git a/scripts/setup-config-alpine b/scripts/setup-config-alpine
index 8ea2347..a013dcb 100755
--- a/scripts/setup-config-alpine
+++ b/scripts/setup-config-alpine
@@ -62,7 +62,7 @@ doas mv "$tmp_xorg_file" /etc/X11/xorg.conf.d/40-libinput.conf
62 62
63tmp_doas_file=$(mktemp) 63tmp_doas_file=$(mktemp)
64cp /etc/doas.d/20-wheel.conf "$tmp_doas_file" 64cp /etc/doas.d/20-wheel.conf "$tmp_doas_file"
65for c in poweroff reboot; do 65for c in poweroff reboot ip udhcpc; do
66 printf 'permit nopass :wheel as root cmd %s\n' "$c" >> "$tmp_doas_file" 66 printf 'permit nopass :wheel as root cmd %s\n' "$c" >> "$tmp_doas_file"
67done 67done
68doas cp "$tmp_doas_file" /etc/doas.d/20-wheel.conf 68doas cp "$tmp_doas_file" /etc/doas.d/20-wheel.conf
@@ -116,6 +116,7 @@ NameResolvingService=resolvconf
116EOF 116EOF
117 117
118doas mv "$tmp_iwd_file" /etc/iwd/main.conf 118doas mv "$tmp_iwd_file" /etc/iwd/main.conf
119doas cp /dev/null /etc/network/interfaces
119 120
120doas rc-update add iwd boot 121doas rc-update add iwd boot
121doas rc-update del networking boot 122doas rc-update del networking boot
diff --git a/scripts/status-linux b/scripts/status-linux
index a88649c..5fa4e13 100755
--- a/scripts/status-linux
+++ b/scripts/status-linux
@@ -27,17 +27,10 @@ else
27 battery="No battery" 27 battery="No battery"
28fi 28fi
29 29
30# NetworkManager has a dreadful command line interface
31# It makes cry every time
32# pls help
33#nwline="$(nmcli device status | head -n 2 | tail -n 1)"
34#nwclean="$(echo "$nwline" | sed 's/ *$//' | sed 's/.* //')"
35#network="Network: $nwclean"
36
37# Thank you iwctl for saving us from this dreadful existence 30# Thank you iwctl for saving us from this dreadful existence
38network="$(iwctl station wlan0 show | grep 'Connected network' | \ 31network="$(iwctl station wlan0 show | grep 'Connected network' | \
39 awk '{$1=$2=""; $0=$0; print}' | sed 's/^ .//')" 32 awk '{$1=$2=""; $0=$0; print}' | sed 's/^ .//')"
40if [ "$(cat /sys/class/net/eth0/carrier 2>/dev/null)" = 1 ]; then 33if [ "$(cat /sys/class/net/eth1/carrier 2>/dev/null)" = 1 ]; then
41 if [ -z "$network" ]; then 34 if [ -z "$network" ]; then
42 network="eth" 35 network="eth"
43 else 36 else

Generated with cgit - Back to sebastiano.tronto.net