cleanup
This commit is contained in:
parent
304e61574e
commit
7a2f5d5930
24 changed files with 123 additions and 63 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue