Question

I need to make a kext which does a very simple function. Whenever a key combination is pressed the kext should kill a process which happens to be "WindowServer"

It has to be a kext due to the nature of the problem. It has to be independent from system's UI so if it hangs up, I can press this combination and restart it.

Can someone provide a starting point? Like how to make a key handler?

Was it helpful?

Solution

I'm not convinced it needs to be a kext. An application that asked you to authenticate for admin powers and then used them (like sudo) to run a command-line tool that killed the WindowServer should do the job just as well. As a bonus, the authentication check prior to running the tool would double as a confirmation dialog.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top