dotfiles/waybar/.config/waybar/ivpn-status.sh
2022-03-06 16:22:37 +01:00

10 lines
347 B
Bash
Executable file

#!/usr/bin/env dash
STATUS=`ivpn status | awk '{print "\\\n"$0}'`
TOOLTIP=`env echo -E ${STATUS} | cut -c 3-`
CLASS=`env echo ${STATUS} | grep 'VPN' | awk '{print $3}' | tr [:upper:] [:lower:]`
[ "$CLASS" = "connected" ] && TEXT="\uf084" || TEXT="\uf071"
env echo "{\"text\": \"${TEXT}\", \"tooltip\": \"${TOOLTIP}\", \"class\": \"${CLASS}\"}"