{"action":"created","issue":{"url":"https://api.github.com/repos/tekezo/Karabiner/issues/458","labels_url":"https://api.github.com/repos/tekezo/Karabiner/issues/458/labels{/name}","comments_url":"https://api.github.com/repos/tekezo/Karabiner/issues/458/comments","events_url":"https://api.github.com/repos/tekezo/Karabiner/issues/458/events","html_url":"https://github.com/tekezo/Karabiner/issues/458","id":100520916,"number":458,"title":"Feature request: provide some API or CLI tool to change profiles from scripts","user":{"login":"netvl","id":280456,"avatar_url":"https://avatars.githubusercontent.com/u/280456?v=3","gravatar_id":"","url":"https://api.github.com/users/netvl","html_url":"https://github.com/netvl","followers_url":"https://api.github.com/users/netvl/followers","following_url":"https://api.github.com/users/netvl/following{/other_user}","gists_url":"https://api.github.com/users/netvl/gists{/gist_id}","starred_url":"https://api.github.com/users/netvl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netvl/subscriptions","organizations_url":"https://api.github.com/users/netvl/orgs","repos_url":"https://api.github.com/users/netvl/repos","events_url":"https://api.github.com/users/netvl/events{/privacy}","received_events_url":"https://api.github.com/users/netvl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-12T11:18:00Z","updated_at":"2015-08-13T08:19:06Z","closed_at":"2015-08-13T08:19:06Z","body":"I often use my Mac with a USB keyboard but I also frequently detach it and go somewhere without keyboard. I therefore have two profiles. It would be great if it was possible to switch these profiles automatically when I attach or detach USB plug for the keyboard.\r\n\r\nThere are several applications for Mac which can detect USB devices plugging/unplugging, but I can't do much with them because Karabiner does not support switching profiles anyhow except from the GUI menu. I came up with a script in AppleScript which opens the menu and toggles the profile for me, but it often fails to work for unknown reason (and recently stopped to work at all, presumably due to an antivirus program).\r\n\r\nSo it would be great if Karabiner provided some kind of CLI tool or some other programmable API which would allow to switch profiles in response to some other program's request. Something like\r\n\r\n    karabinerctl set-profile \"With keyboard\""},"comment":{"url":"https://api.github.com/repos/tekezo/Karabiner/issues/comments/130572155","html_url":"https://github.com/tekezo/Karabiner/issues/458#issuecomment-130572155","issue_url":"https://api.github.com/repos/tekezo/Karabiner/issues/458","id":130572155,"user":{"login":"netvl","id":280456,"avatar_url":"https://avatars.githubusercontent.com/u/280456?v=3","gravatar_id":"","url":"https://api.github.com/users/netvl","html_url":"https://github.com/netvl","followers_url":"https://api.github.com/users/netvl/followers","following_url":"https://api.github.com/users/netvl/following{/other_user}","gists_url":"https://api.github.com/users/netvl/gists{/gist_id}","starred_url":"https://api.github.com/users/netvl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netvl/subscriptions","organizations_url":"https://api.github.com/users/netvl/orgs","repos_url":"https://api.github.com/users/netvl/repos","events_url":"https://api.github.com/users/netvl/events{/privacy}","received_events_url":"https://api.github.com/users/netvl/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T08:19:06Z","updated_at":"2015-08-13T08:19:06Z","body":"Wow, there is a command line interface! Thank you very much! Don't know how I missed it in the docs..."}}