FS#73547 - [sway] polkit is not needed as a dependency
Attached to Project:
Community Packages
Opened by Ayush Agarwal (ayushnix) - Saturday, 29 January 2022, 12:54 GMT
Last edited by Brett Cornwall (ainola) - Friday, 20 May 2022, 19:05 GMT
Opened by Ayush Agarwal (ayushnix) - Saturday, 29 January 2022, 12:54 GMT
Last edited by Brett Cornwall (ainola) - Friday, 20 May 2022, 19:05 GMT
|
Details
I've been able to confirm that sway version 1:1.7-1 works
fine without polkit
and by using seatd instead which is a dependency of wlroots 0.15.0-4 which in turn is a dependency of sway itself. I created a custom PKGBUILD and removed polkit from the list of dependencies. I didn't make any other changes. Here's what I did although some variations of the following steps may also work: - create a group for seatd groupadd -r seatd - add $USER to the seatd group usermod -aG seatd - create, and enable, a systemd service file for seatd using the this upstream link https://git.sr.ht/~kennylevinsen/seatd/tree/master/item/contrib/systemd/seatd.service - reboot the system and sway starts and works without issues I've also tested this with, and without, greetd although I don't think that's relevant. I'm willing to add instructions to the arch wiki page of sway as well if the polkit dependency is removed. The Alpine Linux wiki has some instructions about this setup as well. https://wiki.alpinelinux.org/wiki/Sway If, for some reason, polkit is still desired as a dependency (although I'm not sure why that would be the case), it should probably be made an optional dependency. |
This task depends upon
Do we have any reason to prefer one method over another? I personally don't really care. Functionally, both polkit and seatd seem to serve the same purpose. What benefit does leaning on seatd give us over polkit?
It does bear mentioning that using the seatd method would require user intervention since their user would have to be added to the "seat" group. That means manual intervention, which ultimately means lots of users that will end up with broken systems when they miss the news. :)
@maximbaz: Any opinions?
> What benefit does leaning on seatd give us over polkit?
We would remove an unnecessary dependency considering seatd is bound to be installed when installing sway.
> It does bear mentioning that using the seatd method would require user intervention since their user would have to be added to the "seat" group.
Please correct me if I'm wrong but if we make polkit an optional dependency of sway, users who are unaware of the seatd method of using sway won't be affected in subsequent upgrades. New users who install sway for the first time can choose between using seatd or polkit. Of course, this caveat would need documentation and I'm ready to add that to the sway wiki page.
I've updated seatd to include the upstream service file and created a seat user; The package can be found in [community-testing].
I've also built sway-1.7-3 with the new setup, though that's going to live in [community-staging] until we're going to go forward. This does seem to be the most "correct" path, it's just unfortunate about the inevitable confusion users will get.
@maximbaz, I'll give you some more time to respond if you have any thoughts/opinions. :)
Two comments on the PKGBUILD:
- we probably shouldn't make `seatd` a required dep either, I think it should be together with `polkit` in `optdepends`, indicating that either is an option.
- in addition to `post_upgrade` we probably need a `post_install` too, saying that if you go with `seatd` option, you have to add yourself to the group.
What do you think?
I don't, but I can prepare it within a day or two. Is this the right place to discuss changes to the wiki?
1. seatd may not be needed as a required dependency of sway because sway will need wlroots which in turn needs seatd. I think that makes mentioning seatd as a required dependency of sway as redundant? seatd is also not specified as a dependency of sway on sway's github page (they mention making sway a suid although I don't think we should do that) and libseat (seatd) is mentioned as a dependency of wlroots on their gitlab page.
2. This is unrelated but dmenu is mentioned as an optional dependency of sway. However, dmenu is an Xorg program and needs Xwayland installed and enabled to run. Moreover, if a user has changed the scale of his display, dmenu will appear blurry, which results in a poor user experience. There are many wayland native dmenu replacements such as fuzzel, bemenu, wofi etc. I guess we can either recommend one of these wayland native dmenu programs instead or simply remove dmenu as a suggested optional dependency.
These changes are in sway-1:1.7-6. I'll dogfood it some before pushing it to [community-testing].
Thanks for the feedback!
I've prepared the section that should be added to the sway wiki page. Should I add it?
https://gist.github.com/ayushnix/b4d6eedc64743b3dd5da1c5b024aba3b
https://wiki.archlinux.org/title/Sway#Starting