This commit is contained in:
ange 2025-09-02 05:44:14 +00:00
parent 304e61574e
commit 7a2f5d5930
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
24 changed files with 123 additions and 63 deletions

View file

@ -1,12 +1,16 @@
#!/bin/bash -e
DMENU=/usr/local/bin/dmenu
DMENU=dmenu
SUDO=pkexec
if tty -s; then
DMENU=fzf
SUDO=sudo
fi
if [ "$EUID" = 0 ]; then
SUDO=
fi
d="$(mktemp -d)"
# shellcheck disable=SC2064
trap "rm -rf '$d'" EXIT
@ -29,6 +33,6 @@ if [ "$1" != off ]; then
fi
(inotifywait -e close_write "$d/1"; "$DMENU" < "$d/1" > "$d/2") &
"$SUDO" bash -c "${CMD[*]/%/;}"
$SUDO bash -c "${CMD[*]/%/;}"
touch "$XDG_RUNTIME_DIR/sbar/vpn"
touch "${XDG_RUNTIME_DIR:-/run/user/1000}/sbar/vpn"