It's possible to inhibit the display turn off in kde using ``kde-inhibit --power --screenSaver ```
However, I want to inhibit the display turning off only when playing media (either by spotify or a browser), and let it sleep as usual when not playing media.
How could I achieve this?
Is there a lower level solution that doesn't envolve the DE's setting?
I use qtile on X11 and hyprland on Wayland. There is an option on hyprland for exactly that (idleinhibit window rule), but didn't find a good solution on qtile yet. Anyway I have issues with qtile for other things too (because of X11 mainly).
In KDE there is an option in the system tray called "Display Configuration". If you click on that you can see a checkbox called " Enable Presentation Mode". That's my goto method. Can't really help for other desktop environments.
However I do seem to remember an extension from my Ubuntu and Mint days. I think it was called caffeine. It gave you a little coffee cup in your system tray that would disable sleep/hibernation.
I'm also sure there are ways to do it via the CLI.