Skip to content

Commit

Permalink
Add auto-launch instructions. Fixes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
toothbrush committed Jul 3, 2019
1 parent 4d87ac4 commit 5a8fd56
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions com.debounceMac.app.plist
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 5a8fd56

Please sign in to comment.