I am writing a piece of software in C ++ that controls the keyboard backlight on my MacBook Pro, which runs Arch Linux as the main OS and Debian for funzies. The program works like a daemon and now has the ability to turn on the keyboard backlight. The next step is to monitor when the computer is in standby mode (based on interaction with the mouse and keyboard), and when it is idle for some time, turn off the backlight, and as soon as the interaction with the keyboard or mouse is registered, turn on the backlight.
I have googled around, but I did not find anything that could check when the last interaction with the mouse and / or keyboard was recorded.
Any idea how I can achieve this? I suppose that in some part of any Linux OS (maybe X?) Such possibilities already exist, so using this would be preferable to writing from scratch.
Yours faithfully,...
source
share