Skip to content

Instantly share code, notes, and snippets.

@LoreleiAurora
Last active October 17, 2023 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LoreleiAurora/a6928146bfd2a523237b8fece2fba269 to your computer and use it in GitHub Desktop.
Save LoreleiAurora/a6928146bfd2a523237b8fece2fba269 to your computer and use it in GitHub Desktop.
Bartender - Apple Connect Trigger

Bartender - Apple Connect Trigger

Requirements

Configuration

Screenshot 2023-10-17 at 10 59 52 Screenshot 2023-10-17 at 10 59 12 Screenshot 2023-10-17 at 10 59 21

# vpnutil: https://github.com/Timac/VPNStatus/
# jq: brew install jq
GREP="/usr/bin/grep"
JQ="/opt/homebrew/bin/jq"
VPNUTIL="/Users/lorelei/.local/dotfiles/bin/vpnutil"
if "${VPNUTIL}" list | "${JQ}" -c '.VPNs[] | select(.status | contains("Connected")).name' | "${GREP}" -q "Corporate"; then
echo 1
else
echo 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment