power menu, redshift, polybar
This commit is contained in:
24
.config/polybar/scripts/vpn-expressvpn-status/README.md
Normal file
24
.config/polybar/scripts/vpn-expressvpn-status/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Script: vpn-expressvpn-status
|
||||
|
||||
A small script that shows the status of ExpressVPN.
|
||||
|
||||
It includes a `--toggle` option to connect/disconnect.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
* [`ExpressVPN client`](https://www.expressvpn.com/vpn-software/vpn-linux)
|
||||
|
||||
|
||||
## Module
|
||||
|
||||
```ini
|
||||
[module/vpn-expressvpn-status]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/vpn-expressvpn-status.sh
|
||||
click-left = ~/polybar-scripts/vpn-expressvpn-status.sh --toggle &
|
||||
interval = 10
|
||||
```
|
||||
BIN
.config/polybar/scripts/vpn-expressvpn-status/screenshots/1.png
Normal file
BIN
.config/polybar/scripts/vpn-expressvpn-status/screenshots/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 883 B |
BIN
.config/polybar/scripts/vpn-expressvpn-status/screenshots/2.png
Normal file
BIN
.config/polybar/scripts/vpn-expressvpn-status/screenshots/2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
STATUS=$(expressvpn status)
|
||||
|
||||
expressvpn_toggle() {
|
||||
if [ "$STATUS" != 'Not connected' ]; then
|
||||
expressvpn disconnect
|
||||
else
|
||||
expressvpn connect
|
||||
fi
|
||||
}
|
||||
|
||||
expressvpn_status() {
|
||||
if [ "$STATUS" != 'Not connected' ]; then
|
||||
echo "$STATUS" | head -n1 | cut -d'-' -f2
|
||||
else
|
||||
echo 'not connected'
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--toggle)
|
||||
expressvpn_toggle
|
||||
;;
|
||||
*)
|
||||
expressvpn_status
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user