Need To Create An Automatic Suspend Feature In openSUSE

Hello All,
I am using Leap 15 as my daily driver and everything is working great. I need help or guidance in order to enable a more customizable suspend policy. My suspend/sleep policy is set for 5 minutes, which means that when I walk away from my computer it will automatically suspend itself in 5 minutes. I really need my computer to enter into a sleep state automatically, that is prerequisite for all of my computing tasks.

What I want though is for my computer not go to sleep if I am playing a song through VLC or watching a YouTube video on Firefox. If I am listening to an album, I want the whole album to play without the computer suspending its activities. Also, if I am watching a video on YouTube I want the video to be able to finish before the computer goes to sleep.

I want this auto sleep/suspend policy to be work automatically does it does in Windows, I do not want to go through different screens to change the shut down time everytime that I am playing media. For example I might listen to a 20 minute set of songs or a 3 hour set of songs, but I want the computer to play the whole set then go to sleep. Windows does this automatically, is there any way to set this up in openSUSE?

Thanks in advance.

Rocky

Which desktop is being used?
Where did you set this suspend policy?

I am using the Plasma desktop and I have not set any special suspend feature up. I have just used power management to set the regular 5 minute suspend when inactive, but I would like to have my PC not go to sleep if I am listening to some music.

I guess that this type pf “automatic suspend” feature is not available in any Linux distribution. That is a shame because it has been part of Windows since at least Windows XP which has been 17 years. You would think that at some time this century that some smart coder would be able to make Linux act the same way in regards to suspending/going to sleep. Oh well.

It really needs to be an application driven feature IMHO. Media players could use a dbus call to inhibit power management when active for example. Maybe there are some that already do? Hopefully someone can chime in with further information here.

It is always difficult to define what is an “active” system and what is not (and thus can be suspended).

Just checking if there is any keyboard/mouse activity might be sufficient to suspend the monitor as was done in earlier times, will not be satisfactory when one is looking to a movie or to other dynamically changing window’s content (as the OP found out). A general definition to signal such an application window to the desktop, like mentioned above, is needed IMHO. Something for openDesktop.org? But every player (or other program where this might be needed) must then implement this.

But then again, Linux systems are complete systems, not just running desktops. There may be remote users logged in, servers running (NFS, CUPS, SAMBA, Apache, …).

I assume (but I do not know much about MS Windows) this is more easy as for MS Windows to implement, which is just a desktop and where applications are on a much stricter regime to apply to the MS Windows standards.

Sorry, this is a misnomer, Should be freedesktop.org