Closed haimgel closed 10 months ago
notes: https://unix.stackexchange.com/questions/124886/wake-monitor-from-sleep-remotely
xset -display ${DISPLAY} dpms force on
appears to be working on ubuntu 20.04
One potential issue with using 'xset' to trigger wakeup is that it needs the X display, and if you're running display-switch as root from systemd (as per the readme suggestion) then it doesn't have convenient access to the X display.
A possible alternate implementation would be to use /dev/uinput to simulate a USB keyboard or mouse and send a mouse-move or shift-key keypress. This sounds hairy but the implementation is pretty trivial in C (see https://www.kernel.org/doc/html/v4.12/input/uinput.html) and hopefully not too bad in rust (if you're prepared to trust a random crate off crates.rs then it's definitely pretty simple: https://docs.rs/crate/uinput/0.1.3). It would have the neat advantage that it would then not depend on whether you were running X or not.
@pm215, neat! I'm not too concerned about moving the mouse to wake up screens, this is how this app already does it on Windows, and it works pretty well.
Implemented in #126
The app should wake up the screens when it switches inputs under Linux, the same as it does under Windows and MacOS, e.g. implement wake_displays.