feat: massive cleanup, kctx cache

This commit is contained in:
ange 2025-04-05 06:31:22 +00:00
parent 23d1e06c20
commit a759ac8dd2
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
28 changed files with 320 additions and 1743 deletions

View file

@ -13,16 +13,15 @@ if [ "$EUID" != 0 ]; then
XDG_CACHE_HOME="$XDG_CACHE_HOME" "$BASH" -- "${BASH_SOURCE[0]}" "$@"
fi
if [ -z "$1" ]; then
set -- "$(basename -s.conf /etc/wireguard/*.conf | "$DMENU")"
if [ "$1" != off ]; then
set -- "$(basename -s.conf "/etc/wireguard/$1"*.conf | "$DMENU")"
if ! wg | grep -q "$1"; then
wg-quick up "$1"
fi
fi
while read -r i; do
wg-quick down "$i"
done < <(wg show interfaces)
done < <(ip -br link show type wireguard | awk "\$1 != \"$1\"{print \$1}")
if [ "$1" != off ]; then
wg-quick up "$1"
fi
kill -38 "$(cat "$XDG_CACHE_HOME/pidofbar")"
kill -37 "$(cat "$XDG_CACHE_HOME/sbar/pid")"