diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-06-18 18:37:36 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-06-19 08:31:45 +0200 |
| commit | 090d3e1dd5c66460768f1959e59923e26d49145c (patch) | |
| tree | c3dd5609f7cf06d5ab48d0bc43d1714ec6309b85 | |
| parent | 261d56d343386e520a752281a671028e708960bc (diff) | |
| download | config-090d3e1dd5c66460768f1959e59923e26d49145c.tar.gz config-090d3e1dd5c66460768f1959e59923e26d49145c.zip | |
mount umount no psw
| -rw-r--r-- | .profile | 3 | ||||
| -rwxr-xr-x | scripts/setup-config-alpine | 2 | ||||
| -rwxr-xr-x | scripts/uncolor | 6 |
3 files changed, 9 insertions, 2 deletions
| @@ -42,7 +42,8 @@ alias e='doas ip link set eth1 up && doas udhcpc -i eth1 -n' | |||
| 42 | alias d='iwctl station wlan0 disconnect' | 42 | alias d='iwctl station wlan0 disconnect' |
| 43 | wm() { | 43 | wm() { |
| 44 | iwctl station wlan0 get-networks | \ | 44 | iwctl station wlan0 get-networks | \ |
| 45 | grep '^ ' | sed 's/^ //' | sed 's/ .*//' | grep -v '^$' | \ | 45 | uncolor | tail -n -4 | head -n -1 | \ |
| 46 | grep -e '^ ' | sed 's/^ //' | sed 's/ .*//' | \ | ||
| 46 | fzf | xargs iwctl station wlan0 connect | 47 | fzf | xargs iwctl station wlan0 connect |
| 47 | } | 48 | } |
| 48 | 49 | ||
diff --git a/scripts/setup-config-alpine b/scripts/setup-config-alpine index 414e5be..ab2ef60 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 | ||
| 63 | tmp_doas_file=$(mktemp) | 63 | tmp_doas_file=$(mktemp) |
| 64 | cp /etc/doas.d/20-wheel.conf "$tmp_doas_file" | 64 | cp /etc/doas.d/20-wheel.conf "$tmp_doas_file" |
| 65 | for c in poweroff reboot ip udhcpc; do | 65 | for c in poweroff reboot ip udhcpc mount umount; 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" |
| 67 | done | 67 | done |
| 68 | doas cp "$tmp_doas_file" /etc/doas.d/20-wheel.conf | 68 | doas cp "$tmp_doas_file" /etc/doas.d/20-wheel.conf |
diff --git a/scripts/uncolor b/scripts/uncolor new file mode 100755 index 0000000..81fa743 --- /dev/null +++ b/scripts/uncolor | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Removes ANSI color codes from its stdin, prints to stdout. | ||
| 4 | # Source: https://stackoverflow.com/questions/17998978/removing-colors-from-output | ||
| 5 | |||
| 6 | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' | ||
