This project creates a command-line program named suppressRestartEvent
. The program installs an event tap that detects and suppresses the event generated by the key combination Command-Control-Eject, which triggers an orderly system restart.
To use it:
- Build the project.
- Copy the product (
suppressRestartEvent
) to some stable location. - Change the value of the
Program
key incom.dqd.suppressRestartEvent.plist
to the absolute path of that copy. - Copy the modified
com.dqd.suppressRestartEvent.plist
to$HOME/Library/LaunchAgents
. - Run
launchctl load $HOME/Library/LaunchAgents/com.dqd.suppressRestartEvent.plist
(or reboot).