Wondering if anyone has a workaround to treat controller inputs as something that will keep the computer awake. I like to have my power settings set to timeout the screen after a short period of inactivity due to having an OLED laptop screen (minimize burn in). Problem is if I’m playing a game with a controller, it doesn’t detect that as being “active” and times the screen out. Right now I just go and change the power settings every time I want to play a game with a controller, but it’d be nice if there is a proper way to recognize controller inputs as well, inputs.
From some preliminary searching it seems the problem is they likely don’t present as HID devices on Linux despite doing so on w1ndows. I couldn’t find a solution to that; my instincts say that would need to be fixed at the driver level but its above my pay grade.
Thanks for any tips!
OS: Nobara (Fedora) 38
Controllers tested: Xbox series X|S (wireless and wired), Gulikit King Kong 2 Pro (wireless and wired), Logitech F310 (wired)
Drivers: XOne/Xpadneo installed through Nobara welcome screen
Joystickwake or gamemode ought to help here.
Edit:
Joystickwake reacts dynamically to game controller input, lets the system sleep if you walk away, and requires no per-game setup. It can be installed from a package (official: ubuntu, community: arch, fedora) or just copied from the source code archive and launched from a startup script.
GameMode not only keeps the screen awake, but also tunes system settings like the CPU governor for performance, and keeps those changes in place until you exit the game even if you walk away at a menu screen. Once installed and running, activating it requires prefixing each game’s launch command with
gamemoderun
or using a game manager that knows how to do that for you.You could try systemd-inhibit as a prefix to any game launch command, much in the same way as gamemoderun is used.
Sidebar: this could be considered an example of the XY Problem. You should consider editing the title since the problem you’re really hoping to solve is your laptop going to sleep while you play a game.
While the XY problem sort of applies to this post, I think labeling it as such might be a little too dismissive, since this is one of those rare cases where OP has correctly identified the root cause of the observed issue.
(Easier workarounds exist, but the ideal solution would indeed be fixing the hardware manager’s input idle detection such that it no longer ignores game controllers.)