aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2022-11-17 10:56:25 -0800
committerclarkzjw <[email protected]>2022-11-17 10:56:25 -0800
commitd2d735742ca61b211c9b48a2209d36395daebcf4 (patch)
treebda27729a1bbac3ab354a1f10d4885899cdbf967 /dot_config/i3/scripts/executable_vpn
parenta6d2e5e6fb9adc84c32e86630b4846b1765c7d77 (diff)
downloaddotfiles-d2d735742ca61b211c9b48a2209d36395daebcf4.tar.gz
+ add existing config
Diffstat (limited to 'dot_config/i3/scripts/executable_vpn')
-rw-r--r--dot_config/i3/scripts/executable_vpn25
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
8vpnstatus="📢"
9nordvpn_output=$(nordvpn status | cat -v | head -1 | sed -e 's/\^M-^M ^M//g' )
10if [ "${nordvpn_output}" = "Status: Connected" ]; then
11 vpnstatus="🥸"
12elif [ "${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
19elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then
20 vpnstatus="📢"
21elif [[ "$nordvpn_output" == *\/* ]] || [[ "$nordvpn_output" == *\\* ]]; then
22 vpnstatus="Something's very wrong"
23fi
24
25echo "$vpnstatus"
Powered by cgit v1.2.3 (git 2.41.0)