Add auto-launch instructions. Fixes #2.

This commit is contained in:
Paul David 2019-07-03 21:22:08 +10:00
parent 4d87ac4e8e
commit 5a8fd56e9d
2 changed files with 68 additions and 0 deletions

View File

@ -26,6 +26,50 @@ $ sudo ./debounce
It needs root because it intercepts keystrokes.
If you really want, you can "install" it. Assuming that
`/usr/local/bin` is in your `$PATH` (which it is if you use Homebrew)
you can:
```ShellSession
$ make install
```
### Auto-start at login
Another [helpful
contribution](https://github.com/toothbrush/debounce-mac/issues/2),
this time from @cpouldev. If you'd like to auto-start `debounce` at
login, you might find something like the [included LaunchAgent
configuration](./com.debounceMac.app.plist) helpful.
Put that somewhere `launchctl` can find it, like
`~/Library/LaunchAgents/com.debounceMac.app.plist`, then load the
configuration. macOS will automatically prompt you to give `debounce`
Accessibility access, this is needed to be able to intercept and
modify keystrokes.
```ShellSession
$ launchctl load ~/Library/LaunchAgents/com.debounceMac.app.plist
```
macOS will automatically prompt you to give `debounce` Accessibility
access, this is needed to be able to intercept and modify keystrokes.
When that's done, start it.
```ShellSession
$ launchctl start com.debounceMac.app
```
To remove / uninstall completely:
```ShellSession
$ launchctl stop com.debounceMac.app
$ launchctl unload ~/Library/LaunchAgents/com.debounceMac.app.plist
$ rm ~/Library/LaunchAgents/com.debounceMac.app.plist
$ launchctl list
$ rm /usr/local/bin/debounce
```
### Accessibility / permissions
You might get an error something like the following, even when running

24
com.debounceMac.app.plist Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin</string>
</dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<true/>
</dict>
<key>Label</key>
<string>com.debounceMac.app</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/debounce</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>