Skip to content

Instantly share code, notes, and snippets.

@tcotav
Last active June 2, 2018 18:48
Show Gist options
  • Save tcotav/b3cba851ba473bb7d32343ba127d0a34 to your computer and use it in GitHub Desktop.
Save tcotav/b3cba851ba473bb7d32343ba127d0a34 to your computer and use it in GitHub Desktop.
osx toolbar bettertouchtool json -- am I on VPN or no (look for global protect interface)
{
"BTTWidgetName" : "VPN Status",
"BTTTriggerType" : 639,
"BTTTriggerTypeDescription" : "Apple Script Widget",
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : 172,
"BTTPredefinedActionName" : "Run Apple Script (blocking)",
"BTTInlineAppleScript" : "set activeInterfaces to do shell script \"ifconfig -lu\"\rif activeInterfaces is not \"lo0 en0 p2p0 awdl0 en2 en1 en3 en4 bridge0 utun0 utun1 utun2 utun3 utun4 en6\" then\r\treturn \"VPN - Connected\"\rend if\rreturn \"VPN - Disconnected\"",
"BTTScriptType" : "AppleScript",
"BTTEnabled2" : 1,
"BTTEnabled" : 1,
"BTTOrder" : 4,
"BTTTriggerConfig" : {
"BTTTouchBarItemIconHeight" : 22,
"BTTTouchBarItemIconWidth" : 22,
"BTTTouchBarItemPlacement" : 1,
"BTTTouchBarItemPadding" : 0,
"BTTTouchBarFreeSpaceAfterButton" : "5.000000",
"BTTTouchBarButtonColor" : "0.000000, 209.206028, 6.891371, 255.000000",
"BTTTouchBarAlwaysShowButton" : "0",
"BTTTouchBarAppleScriptString" : "set s to do shell script \"ifconfig -lu\"\rset vpnActive to offset of \"gpd0\" in s\rif vpnActive = 0 then\r\treturn \"VPN Disconnected\"\rend if\rreturn \"VPN Connected\"",
"BTTTouchBarColorRegex" : "Disconnected",
"BTTTouchBarAlternateBackgroundColor" : "255.000000, 0.000000, 0.000000, 255.000000",
"BTTTouchBarScriptUpdateInterval" : 5
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment