#!/bin/sh

STATUS=`protonvpn status | awk '{print "\\\n"$0}'`
TOOLTIP=`echo -E ${STATUS} | cut -c 3-`
CLASS=`echo ${STATUS} | grep 'Status' | awk '{print $2}'`
TEXT=""

if [ $CLASS == "Connected" ]; then
    TEXT="\uf084" # key
else
    TEXT="\uf071" # exclamation-triangle
fi

echo "{\"text\": \"${TEXT}\", \"tooltip\": \"${TOOLTIP}\", \"class\": \"${CLASS}\"}"

