How can I prevent sleep and screen locking only while a specific app is running?
Asked by
MellowCedar42
My KDE Debian system is configured to suspend after five minutes of inactivity. I use a digital audio workstation and want the computer to stay awake—and ideally avoid locking the screen—while that application is open. Once the app closes, the normal power-saving behavior should resume. Is there a way to configure this per application rather than disabling sleep system-wide?
Answers
Launch the application through systemd-inhibit so it temporarily blocks suspend while it is running. For example, replace the app command with `systemd-inhibit bitwig-studio`. In KDE, you can edit the application’s entry in the Menu Editor, and this should also work when launching it from the menu or task manager.
Reply to this answer
You can also configure the system to remain awake all the time, but that affects every application. Using an inhibitor for only the DAW is better if you want normal sleep behavior to return automatically when the program closes.
Reply to this answer
Add your answer
Answers are reviewed before publication.
MellowCedar42: Thanks, that solved it! Editing the application command in KDE’s Menu Editor worked perfectly.