Hello, On samedi 19 janvier 2019 12:19:10 CET Elvis Angelaccio wrote: > On 16/01/19 22:07, Matthieu Gallien wrote: > > Hello, > > > > I am trying to work on a feature request to add the ability to suppress > > laptop sleep when playing music. > > > > Currently, Juk is doing it via dbus calls to > > "org.kde.Solid.PowerManagement". > > > > I also had a look to Solid frameworks and the power classes that add an > > asynchronous way to do that. > > Currently, the Solid framework only conditionally provides those features > > and it seems distributions (at least Debian) do not always build it. > > > > I am also unsure about the current recommended solution that would work > > for > > most desktop environments. > > > > What would be the best way forward ? > > Hi, > the "official" way to achieve that should be a dbus call to the > org.freedesktop.ScreenSaver interface (methods Inhibit and UnInhibit).
I had thought that would only inhibit the screensaver instead of automatic sleep. I did a quick test and in case I inhibit through org.freedesktop.ScreenSaver interface, the battery applet does not indicate any inhibit whereas through org.freedesktop.PowerManagement.Inhibit indicates that an inhibition is valid. I wonder if I should not instead make usage of the Inhibit mechanism from logind coupled with powerdevil. I am not sure if this is desired. I would forward inhibit request to logind and checks existing inhibition before allowing powerdecil to suspend. > > I can also see some other features that could make sense to provide in > > libraries that music players could use (lyrics fetching, album art > > fetching, ...). This could be in a dedicated framework to help build > > media players. > > > > Best regards > > > > -- > > Matthieu Gallien > > Cheers, > Elvis Best regards