Session managers already do something similar for screen savers (though that's in user's session scope, not global). Also desktop environment developers have introduced lots of new odd daemons recently, I'm surprised they haven't came up with a suspend policy framework yet.
I've currently set all my computers to suspend after 1 hour of inactivity which works great, but I'd like to block suspend when I'm just using my computer to play music and not otherwise using the computer. Also, I want to suspend my laptop, but not when I have music playing. This seems impossible to do for now and makes opportunistic suspend quite annoying. Also I don't want my laptop suspending when I'm listening to music and just close the lid. I just want the screen to shut off its backlight.
So music players could come with a checkbox "[x] Block suspend while playing music" and my BitTorrent client could have "[x] Block suspend until downloads have completed"
Combined with wake-on-LAN, I see this could even be useful for home servers (e.g. NAS) to save power while everyone is asleep.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds