dotfiles/.i3blocks/vpn

16 lines
341 B
Text
Raw Normal View History

#!/bin/bash
if nmcli dev | grep tun0 | cut -f3 | grep " connecté" &>/dev/null
then
2020-12-31 11:14:20 +01:00
echo "<span foreground=\"#99CC99\">rpv</span>"
2019-04-19 22:18:25 +02:00
[[ ! -f /dev/shm/vpn ]] && echo 1 > /dev/shm/vpn
else
2020-12-31 11:14:20 +01:00
echo "<span foreground=\"#747369\">rpv</span>"
2019-04-19 22:18:25 +02:00
if [[ -f /dev/shm/vpn ]]
then
2020-12-31 11:14:20 +01:00
notify-send -u critical "RPV" "Déconnecté"
2019-04-19 22:18:25 +02:00
rm /dev/shm/vpn
fi
fi