diff options
author | clarkzjw <[email protected]> | 2022-11-17 10:56:25 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2022-11-17 10:56:25 -0800 |
commit | d2d735742ca61b211c9b48a2209d36395daebcf4 (patch) | |
tree | bda27729a1bbac3ab354a1f10d4885899cdbf967 /dot_config/i3/scripts/executable_vpn | |
parent | a6d2e5e6fb9adc84c32e86630b4846b1765c7d77 (diff) | |
download | dotfiles-d2d735742ca61b211c9b48a2209d36395daebcf4.tar.gz |
+ add existing config
Diffstat (limited to 'dot_config/i3/scripts/executable_vpn')
-rw-r--r-- | dot_config/i3/scripts/executable_vpn | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dot_config/i3/scripts/executable_vpn b/dot_config/i3/scripts/executable_vpn new file mode 100644 index 0000000..a348f96 --- /dev/null +++ b/dot_config/i3/scripts/executable_vpn | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | # | ||
3 | # Copyright (C) 2021 Andreas Lindlbauer | ||
4 | # Licensed under the terms of EUPLv1.2. | ||
5 | # | ||
6 | # i3blocks blocklet script to monitor the (nord)vpn connection | ||
7 | |||
8 | vpnstatus="📢" | ||
9 | nordvpn_output=$(nordvpn status | cat -v | head -1 | sed -e 's/\^M-^M ^M//g' ) | ||
10 | if [ "${nordvpn_output}" = "Status: Connected" ]; then | ||
11 | vpnstatus="🥸" | ||
12 | elif [ "${nordvpn_output}" = "A new version of NordVPN is available! Please update the application." ]; then | ||
13 | nordvpn_output=$(nordvpn status | cat -v | head -2 | tail -1 | sed -e 's/\^M-^M ^M//g' ) | ||
14 | if [ "${nordvpn_output}" = "Status: Connected" ]; then | ||
15 | vpnstatus="🥴" | ||
16 | elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then | ||
17 | vpnstatus="📢" | ||
18 | fi | ||
19 | elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then | ||
20 | vpnstatus="📢" | ||
21 | elif [[ "$nordvpn_output" == *\/* ]] || [[ "$nordvpn_output" == *\\* ]]; then | ||
22 | vpnstatus="Something's very wrong" | ||
23 | fi | ||
24 | |||
25 | echo "$vpnstatus" | ||