wakepy icon indicating copy to clipboard operation
wakepy copied to clipboard

Make it possible for the user to select the used method

Open fohrloop opened this issue 1 year ago • 4 comments

On linux, there are multiple methods which could be used:

  • jeepney (dbus without libdbus)
  • dbus-python (dbus with libdbus)
  • systemd

These all are tried in order. It would be nicer for the user if the method could be selected when setting the keepawake. An iterable of methods could also be accepted.

Possible syntax:

with keepawake(method_linux='jeepney'):
   ...

or

with keepawake(method_linux=('jeepney', 'systemd')):
   ...

etc.

fohrloop avatar Apr 07 '23 13:04 fohrloop

Working on this & planning to put it to the next release.

fohrloop avatar Apr 08 '23 17:04 fohrloop

This should be done now, and available in the dev branch. Will merge to master and publish a version in PyPI once tests and docs are also ready.

fohrloop avatar Apr 10 '23 13:04 fohrloop

I'm reconsidering if this should be part of 0.8.0 yet. There are already quite many changes coming, so it might be good to get those published anyway. If this is really easy task to implement and test, going to push it in 0.8.0. Otherwise, add in another release.

My main concern is about the correct API for this. Should it be possible to select the used methods or to give the priority order or to do both? Methods for the "current platform" should probably be always prioritized before any other methods (as the others will not be used).

fohrloop avatar Oct 29 '23 15:10 fohrloop

The implementation is already merged in dev and will be part of 0.8.0. This still needs documentation in order to be closed.

fohrloop avatar Jan 16 '24 20:01 fohrloop