forked from colonelpanic/dotfiles
Add tccutil command for assitive devices handling
This commit specifically enables synergy support.
This commit is contained in:
parent
2f6e2e23c9
commit
473d78dcbd
20
tasks/osx.py
20
tasks/osx.py
@ -76,6 +76,7 @@ APPS_NEEDING_ASSISTIVE_DEVICE_ACCESS = ('Slate', 'Synergy', 'iTerm')
|
||||
|
||||
@ctask
|
||||
def access_for_assistive_devices(ctx):
|
||||
# TODO: refactor to use tccutil.py
|
||||
for app in APPS_NEEDING_ASSISTIVE_DEVICE_ACCESS:
|
||||
app_string = '/Applications/{0}.app'.format(app)
|
||||
user_application = os.path.expanduser('~' + app_string)
|
||||
@ -91,6 +92,25 @@ def access_for_assistive_devices(ctx):
|
||||
"Karabiner_AXNotifier.app"
|
||||
)
|
||||
|
||||
SYNERGY_BINARIES_PATH = '/Applications/Synergy.app/Contents/MacOS/'
|
||||
|
||||
SCRIPTS_NEEDING_ASSISTIVE_DEVICE_ACCESS = [
|
||||
os.path.join(SYNERGY_BINARIES_PATH, 'synergyc'),
|
||||
os.path.join(SYNERGY_BINARIES_PATH, 'synergys'),
|
||||
"org.gnu.Emacs",
|
||||
"com.googlecode.iterm2",
|
||||
]
|
||||
|
||||
@ctask
|
||||
def tccutil(ctx):
|
||||
for script in SCRIPTS_NEEDING_ASSISTIVE_DEVICE_ACCESS:
|
||||
ctx.run(
|
||||
'sudo tccutil -i "{}"'.format(script)
|
||||
)
|
||||
ctx.run(
|
||||
'sudo tccutil -e "{}"'.format(script)
|
||||
)
|
||||
|
||||
|
||||
def access_if_exists(ctx, app_string):
|
||||
if os.path.exists(app_string):
|
||||
|
Loading…
Reference in New Issue
Block a user