From 13994fa458890fcf0e81c3ff2785afaea387f516 Mon Sep 17 00:00:00 2001 From: spinach <19keegandeppe@gmail.com> Date: Sat, 6 May 2023 18:24:09 -0400 Subject: [PATCH] VPN status check --- bin/vpn_status.sh | 25 +++++++++++++++++++++++++ gui/polybar/config.ini | 12 +++++++++--- meta/configs/scripts.yaml | 1 + passwords/gnupg/pubring.kbx | Bin 17548 -> 21702 bytes passwords/gnupg/pubring.kbx~ | Bin 16174 -> 17548 bytes 5 files changed, 35 insertions(+), 3 deletions(-) create mode 100755 bin/vpn_status.sh diff --git a/bin/vpn_status.sh b/bin/vpn_status.sh new file mode 100755 index 0000000..671aecd --- /dev/null +++ b/bin/vpn_status.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# checks mullvad status for monitoring in polybar + +CONNECTED=$(printf '%s%s' '%{F#0F0}' $(echo -e '\Uf0318')) # green +DISCONNECTED=$(printf '%s%s' '%{F#F00}' $(echo -e '\Uf0319')) # red + +# check that its installed +if ! command -v mullvad &>/dev/null ; then + echo "Seafile not downloaded to device!">&2 + echo "$DISCONNECTED" + exit 1 +fi + +# getting vpn status +VPN_DISCONNECTED=$(mullvad status | grep Disconnected) + +if [[ -n "$VPN_DISCONNECTED" ]] ; then + # vpn is disconnected + echo "$DISCONNECTED" + exit 0 +fi + +# connected +echo "$CONNECTED" diff --git a/gui/polybar/config.ini b/gui/polybar/config.ini index d3db9c3..f56977b 100644 --- a/gui/polybar/config.ini +++ b/gui/polybar/config.ini @@ -6,7 +6,7 @@ foreground = #DDD primary = #F0C674 secondary = #8ABEB7 disabled = #707880 -alert = #A54242 +alert = #A54242S [section/base-bar] ; base bar settings @@ -38,7 +38,7 @@ font-0 = Hack Nerd Font:size=10;2 height = 14pt ; modules modules-left = xworkspaces weather-thinkpad -modules-right = battery pulseaudio memory cpu wlan uptime seafile calendar-sync bg-selector date-tp powermenu +modules-right = battery pulseaudio memory cpu wlan vpn uptime seafile calendar-sync bg-selector date-tp powermenu [bar/desktop-bar] ; desktop bar config @@ -49,7 +49,7 @@ height = 24pt modules-left = xworkspaces focus-fast spotify spotify-len ;modules-left = xworkspaces spotify spotify-len modules-center = weather-desktop -modules-right = pulseaudio memory cpu temperature eth dev-bat packages seafile calendar-sync bg-selector quotes date powermenu +modules-right = pulseaudio memory cpu temperature eth vpn dev-bat packages seafile calendar-sync bg-selector quotes date powermenu [bar/work-bar] ; desktop bar config @@ -303,5 +303,11 @@ type = custom/script interval = 600 exec = printf "%s %s\n" `echo -e '\ueb29'` `pacman -Qu | wc -l` +[module/vpn] +; custom vpn script +type = custom/script +exec = vpn_status.sh +interval = 30 + [settings] screenchange-reload = true diff --git a/meta/configs/scripts.yaml b/meta/configs/scripts.yaml index 9422c89..40ec5c0 100644 --- a/meta/configs/scripts.yaml +++ b/meta/configs/scripts.yaml @@ -14,6 +14,7 @@ ~/.local/bin/markdown-preview.sh: bin/markdown-preview.sh ~/.local/bin/docker_check: bin/docker_check ~/.local/bin/seafile_check: bin/seafile_check + ~/.local/bin/vpn_status.sh: bin/vpn_status.sh ~/.local/bin/watertracker: src/watertracker/watertracker ~/.local/bin/device_battery.sh: src/device-battery/device_battery.sh ~/.local/bin/weather: src/weather/weather diff --git a/passwords/gnupg/pubring.kbx b/passwords/gnupg/pubring.kbx index 86948478a7e62b7157729486f4d42e9fdaba756c..84b72d89b0f0fc7bbc105e339749c06bb787b1fb 100644 GIT binary patch delta 4155 zcmaKubyO5u*T#n#T9odgb4EhCVI-7pL;*phk&+IbAp{12OG$SM7wLwfBqWFKa%hkd zkPyiiz3Z-bec!j%xBoh4Kj-}S?BBDaB5-<3a4Mse5dZ+0G!O^yyRrZPQX~Kb0O!(& z125%?iAu^%y{2*}f7mWZuiWaazaI^R6j&Odo=zvyVb$_%f_~8V32EN8Wq)ft{;PHc zME#waruVHn!^imuvre^d+fRRMw}k^B0RVv0wZese6|eebMv{%rz3VGgZs=9XwW2hF9ZC9cV0=Q1m1Nz?jd?Q0m- zqoOv8J?+qreiwr!Ng^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=bt|JT|-Tdngs=@l*d zy#>=UrTTd>KE~H~rwXBOS(8`KXe>LD&NZX#IfMvDbXL65k=(&3l-u#9?*B*&ZY(pD zOtW~d($&uZQ)q@nSet05G8!yMD}x(e`-5%%v!f2G^W5yORo zSJ6YiBozc2c(&zUpuKWg7UR%uyJqa8gNqLax-v%4)zSqYMOnMjWfE1dHzaVwkH28l z!x4@cAp^p*3x=Xd+rJr10#(_}9^5;tJ zhRpErpiG5RYL~z#Yakxqhn!q*R|VSpMD$|4fbCvwEd4Kt!>cjFg3pKygwkUTw;c$5 zs*v+S%HC30-phHk1wRsW&Q9znuXE^+-y#T^iQPr{sEW@$OmJT!!{#bDjr;qYudB|{ zt0zCQw07G%g5*E#!ouM->Nm2QGO~sGdpsd}JbaMCkP*@x*4V;)6m{XRHt?#H4q!O!th>MdI~9ztsw#1s=vthR(`RCcZu z7e~0(WeldwRw!Cw$7}vg83Sy>8(gC{b$Zsu%@Nu|rq#$}K+46~6G=1G`G3JunjC&U UB-7BL*=n`OdjRRrq*r734=a(ww*UYD delta 9 QcmX@MlCh_gaYK&_02Q+Y2LJ#7 diff --git a/passwords/gnupg/pubring.kbx~ b/passwords/gnupg/pubring.kbx~ index 8236d67f71b82877e0854b7e0f3d936423c01c47..86948478a7e62b7157729486f4d42e9fdaba756c 100644 GIT binary patch delta 1356 zcmYk4do z#HhuLisX_qh%VT&TMWgf)w&Czm>u?X&OU#=@AJOzdH;Ambt!o{2rkY(6acY62m!X0 z0s!(EfB6Aa_xvx6?xaSw!EZOgjrt4s07tLV6ASpzDr_vzZ$g<-a3ED#lfnzpYV=6Zfj8$!=AdHg(kgO6Mklv zQs6lX8$!v{1FxgO_6n-rgyEvOoA3QRzPzIMYLcQ~hrLY7ov1!UGdd!iE7yRpTx9O| zDbb-?^|8)%g7R9r(0n!ynOwk>7`fo&g<3T@+6-^1ut$5H%6j2rcOcHah8OKE!PDL5 z)+Xarc2_+>5fNO&La%U%>gyks3q75vdeAt|))eA+&P{vICJyi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