r/macosprogramming • u/raynoralpha123 • Apr 27 '24
App to disable touchpad while typing, how to autostart it?
Hello!
I have found this Touchguard app/script that works great, but couldnt manage to get it to autostart with MacOS Sonoma. Do you guys know how to do it?
GitHub - thesyntaxinator/TouchGuard: Disable mac touchpad while typing to avoid cursor jumping
I really recommend it if you use Trackpad 2 in the middle with a external keyboard.
Wish you a great day.
1
Upvotes
1
u/retsotrembla Apr 28 '24
I've read the source code, and the reason it wants administrative access is because it is 8 years old, so it doesn't know how to do things the modern way.
That project has been forked 5 times, but no forks in the last 5 years.
Take a look at https://github.com/thealpa/SaneSideButtons.git for an example of a different app that is using the same event trap functionality as TouchGuard that has the Sandbox and HardenRuntime capabilities, does not require
sudo, and has directions on its README on to have it autostart at login by setting it as a Login Item in System SettingsSaneSideButtons is in Swift and is a fork of the earlier https://github.com/archagon/sensible-side-buttons.git which is extremely similar but in Objective-C.
1
u/retsotrembla Apr 29 '24
There is an easier way out:
from the command line:
move the executable to /usr/local/bin - that's the place for command-line commands not from apple.
remove that file's write permission, making it read-only
make it owned by
rootmake it setuid root:
from now on, you can omit the
sudowhen you call it, This reduces your problem to:How do I start automatically when I log in to my Mac a comand-line command that takes arguments?