dwmb-vpn (967B) - raw


      1 #!/bin/bash
      2 # Outputs if Express VPN is connected or not
      3 
      4 vpnstatus="$(piactl get connectionstate)"
      5 
      6 case "$vpnstatus" in
      7 	Disconnected) icon=" " ;;
      8 	Connecting) icon="  " ;;
      9 	Connected) icon=" " ;;
     10 	Interrupted) icon="  " ;;
     11 	Reconnecting) icon="  " ;;
     12 	DisconnectingToReconnect) icon="  ";;
     13 	Disconnecting) icon="  " ;;
     14 esac
     15 
     16 # case "$vpnstatus" in
     17 # 	*"Not"*) icon=""
     18 # 		;;
     19 # 	*"Connected"*) icon=""
     20 # 		;;
     21 # 	*"Connecting"*) icon=" "
     22 # 		;;
     23 # 	*) icon=""
     24 # esac
     25 
     26 echo " $icon"
     27 
     28 
     29 # \033]01;31\] # pink
     30 # \033]00m\]   # white
     31 # \033]01;36\] # bold green
     32 # \033]02;36\] # green
     33 # \033]01;34\] # blue
     34 # \033]01;33\] # bold yellow
     35 # s/onnected\sto\s//;
     36 case $BLOCK_BUTTON in
     37 	1) piactl connect && notify-send -a "VPN" "Connected" && kill -36 $(pidof dwmblocks);;
     38 	2) vpnmenu ;;
     39 	3) piactl disconnect && notify-send -a "VPN" "Disonnected" && kill -36 $(pidof dwmblocks);;
     40 	6) "$TERMINAL" -e "$EDITOR" "$0" ;;
     41 esac