summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.profile3
-rwxr-xr-xscripts/setup-config-alpine2
-rwxr-xr-xscripts/uncolor6
3 files changed, 9 insertions, 2 deletions
diff --git a/.profile b/.profile
index 0d99542..bdffbdf 100644
--- a/.profile
+++ b/.profile
@@ -42,7 +42,8 @@ alias e='doas ip link set eth1 up && doas udhcpc -i eth1 -n'
42alias d='iwctl station wlan0 disconnect' 42alias d='iwctl station wlan0 disconnect'
43wm() { 43wm() {
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
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 ip udhcpc; do 65for 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"
67done 67done
68doas cp "$tmp_doas_file" /etc/doas.d/20-wheel.conf 68doas 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
6sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g'

Generated with cgit - Back to sebastiano.tronto.net