alex-courtis / way-displays

way-displays: Auto Manage Your Wayland Displays
MIT License
239 stars 12 forks source link

[Feature request] Cooperate with login managers (such as elogind) #159

Open inga-lovinde opened 3 months ago

inga-lovinde commented 3 months ago

Note: I'm not very knowledgeable about Linux, and this issue title might be incorrect.

I'm using Alpine with elogind + greetd launching river on login. When my user does not belong to input group, I'm getting error messages like this one in way-displays logs:

WARNING: libinput open /dev/input/event1 failed: 13 Permission denied

and then of course lid events are not processed.

Adding myself to input group, as way-display readme says, solves the issue.

However, how other people, more knowledgeable about Linux, told me, it's a bad idea to explicitly add myself to the input group, because it "breaks wayland security model in which one programs can't poke on input of other programs". "The point of elogind is to avoid adding users to input/video/etc groups", and I don't have to be in video group to use river, or in audio group to use audio software via alsa/pipewire.

As I understand, ideally way-displays would somehow (integrate with libseat?) "go through elogind [and d-bus] to access devices", which would make it work for all users regardless of whether they are in input group or not.

alex-courtis commented 3 months ago

Yes, it's not great security practice, yes dbus is the proper way to do this.

I did look at it but it's non-trivial to implement.

I'd be most grateful if you could raise a Pull Request to make this change; it's unlikely that I'll be able to allocate time for this.