Waybar: ivpn module sends notification on click

This commit is contained in:
the_4n0nym0u53 2021-12-15 13:04:43 +01:00
parent b90a360321
commit b340176def
No known key found for this signature in database
GPG key ID: 35EE09F5481049BB
3 changed files with 7 additions and 2 deletions

View file

@ -116,9 +116,9 @@
},
"custom/ivpn": { // Custom status module for IVPN
"format": "{} IVPN",
"exec": "$HOME/.config/waybar/ivpn.sh",
"exec": "$HOME/.config/waybar/ivpn-status.sh",
"return-type": "json",
"interval": 1,
"on-click": "ivpn connect -last"
"on-click": "$HOME/.config/waybar/ivpn-reconnect.sh"
}
}

View file

@ -0,0 +1,5 @@
#!/bin/sh
ivpn connect -last \
&& notify-send -u low "IVPN" "Successfully reconnected to IVPN server:\n$(ivpn status | sed -n 2p | xargs)" \
|| notify-send -u critical "IVPN" "Failed to reconnect to IVPN\!"