Configuration file for dwm-bar on macbook air
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
691 B

  1. #!/bin/sh
  2. # A dwm_bar function to show VPN connections with OpenVPN or WireGuard (if any are active)
  3. # Joe Standring <git@joestandring.com>
  4. # GNU GPLv3
  5. # Dependencies: NetworkManager, NetworkManager-openvpn (for OpenVPN connections)
  6. dwm_vpn () {
  7. VPN=$(nmcli -a | grep 'VPN connection' | sed -e 's/\( VPN connection\)*$//g')
  8. if [ "$VPN" = "" ]; then
  9. VPN=$(nmcli connection | grep 'wireguard' | sed 's/\s.*$//')
  10. fi
  11. if [ "$VPN" != "" ]; then
  12. printf "%s" "$SEP1"
  13. if [ "$IDENTIFIER" = "unicode" ]; then
  14. printf "🔒 %s" "$VPN"
  15. else
  16. printf "VPN %s" "$VPN"
  17. fi
  18. printf "%s\n" "$SEP2"
  19. fi
  20. }
  21. dwm_vpn