swaywm / swayidle

Idle management daemon for Wayland
MIT License
550 stars 50 forks source link

Drop logind integration #117

Open emersion opened 2 years ago

emersion commented 2 years ago

It's hard to maintain, it's the source of many bugs, and it duplicates functionality with Wayland-native interfaces which provide the same functionality.

bowmanjd commented 2 years ago

Curious what this would mean... Would everything enabled by HAVE_SYSTEMD no longer exist?

kennylevinsen commented 2 years ago

Curious what this would mean... Would everything enabled by HAVE_SYSTEMD no longer exist?

Yes, HAVE_SYSTEMD and HAVE_ELOGIND.

bowmanjd commented 2 years ago

Yes, HAVE_SYSTEMD and HAVE_ELOGIND.

Thank you. Just considering what features will not be sticking around. I am assuming lock, unlock, and idlehint would go away.

I am less certain how to handle locking the screen after, say, laptop lid close, if I am right that before-sleep would be removed. I guess this could be left entirely to systemd, though. If this is possible using "Wayland-native interfaces", then I am eager to see what documentation updates would accompany this change.

Thanks for all the work you all are doing on this project. Such a useful tool!

kennylevinsen commented 2 years ago

before-sleep only has value when you are trying to have both sway/swayidle and logind handle idle actions like suspending.

Just remove the actions from /etc/systemd/logind.conf and use swayidle and sway bindsym/bindswitch to trigger suspend.

For idle actions, there is no point in having sway tell swayidle, which the tells logind, which then runs actions when swayidle is meant to run them directly. For button actions, it makes no sense to have logind waste resources by eavesdropping in all input devices when sway bindsyms can do the trick. For direct loginctl suspend calls, just start swaylock first.

dkwo commented 2 years ago

Would this allow swayidle to work even without dbus? Currently, at least on void linux, I get errors and swayidle does not work if dbus is not present.

emersion commented 2 years ago

swayidle can already work without dbus if you compile it with logind support disabled.

dkwo commented 2 years ago

I see. Indeed it works even now (from void repo), even though it prints

2022-03-16 16:27:47 - [Line 471] Failed to open D-Bus connection: No such file or directory 2022-03-16 16:27:47 - [Line 520] Failed to add D-Bus signal match : property changed: Invalid argument 2022-03-16 16:27:47 - [Line 278] Failed to parse get BlockInhibited property: Invalid argument

LinArcX commented 2 years ago

What are the alternatives guys?

I have void Linux and I can't use swayidle functionalities like before-sleep.

kennylevinsen commented 2 years ago
  1. We have not removed it yet, so before-sleep still works.
  2. The alternative to before-sleep is just not using it and calling whatever you need to run before suspend - you'll never guess it -before you call suspend.
nyonson commented 2 years ago

Not a Void linux alternative because still systemd-based, but I think systemd-lock-handler could replace before-sleep if one wishes to still use logind events for whatever reason, but not have to do the work of getting them to user (instead of system) space.

boucman commented 2 years ago

hmm, when swayidle tells logind that the system is idle, IIUC logind will lock all the sessions (for the lock action) of all users.

it's a bit more complicated than that, but i'm not sure swayidle alone can reproduce that feature...

inherently, locking, hibernating etc is a system action, so logind is the passage from user demands to system actions and i'm not sure how to properly work around that.

eternal-sorrow commented 9 months ago

So there will be no support for lock? That's too bad.