fix issue with vpn waybar button
This commit is contained in:
0
.config/waybar/scripts/askpass.sh
Normal file → Executable file
0
.config/waybar/scripts/askpass.sh
Normal file → Executable file
@ -95,7 +95,7 @@ else
|
||||
|
||||
active_device=$(nmcli -t -f DEVICE,STATE device status |
|
||||
grep -w "connected" |
|
||||
grep -v -E "^(dummy|lo:|virbr0)" |
|
||||
grep -v -E "^(dummy|lo|virbr0|wg0):" |
|
||||
awk -F: '{print $1}')
|
||||
|
||||
if [ -n "$active_device" ]; then
|
||||
|
@ -7,10 +7,6 @@ function status_wireguard() {
|
||||
return $?
|
||||
}
|
||||
|
||||
function askpass() {
|
||||
rofi -dmenu -password -no-fixed-num-lines -p "Sudo password"
|
||||
}
|
||||
|
||||
status_wireguard && \
|
||||
SUDO_ASKPASS=~/.config/waybar/scripts/askpass.sh sudo -A systemctl stop $SERVICE_NAME || \
|
||||
SUDO_ASKPASS=~/.config/waybar/scripts/askpass.sh sudo -A systemctl start $SERVICE_NAME
|
||||
|
Reference in New Issue
Block a user