mirror of
https://github.com/toothbrush/debounce-mac.git
synced 2024-10-26 07:07:55 +03:00
Merge pull request #6 from toothbrush/autostart
Add instructions for auto-launch.
This commit is contained in:
commit
cdbe6e8fda
@ -1,6 +1,9 @@
|
|||||||
|
.PHONY: all
|
||||||
all: debounce
|
all: debounce
|
||||||
|
|
||||||
debounce: debounce.m
|
debounce: debounce.m
|
||||||
clang -fobjc-arc -framework Cocoa ./debounce.m -o $@
|
clang -fobjc-arc -framework Cocoa $^ -o $@
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: install
|
||||||
|
install: debounce
|
||||||
|
cp $< /usr/local/bin
|
||||||
|
44
README.md
44
README.md
@ -26,6 +26,50 @@ $ sudo ./debounce
|
|||||||
|
|
||||||
It needs root because it intercepts keystrokes.
|
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
|
### Accessibility / permissions
|
||||||
|
|
||||||
You might get an error something like the following, even when running
|
You might get an error something like the following, even when running
|
||||||
|
24
com.debounceMac.app.plist
Normal file
24
com.debounceMac.app.plist
Normal 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>
|
Loading…
Reference in New Issue
Block a user