- jq
brew install jq
- vpnutil
- Download from https://github.com/Timac/VPNStatus/
- Set path to
vpnutil
binary asVPNUTIL
var on trigger.sh line 6
Last active
October 17, 2023 10:02
-
-
Save LoreleiAurora/a6928146bfd2a523237b8fece2fba269 to your computer and use it in GitHub Desktop.
Bartender - Apple Connect Trigger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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