Seatd: Difference between revisions

From Alpine Linux
(added reference wrapper script, rephrased headings and sentence)
(removed the repetetive information for starting sway as the info has already been added to sway)
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Seatd is a seat management daemon, that does everything it needs to do. Nothing more, nothing less. Depends only on libc. Seat management takes care of mediating access to shared devices (graphics, input), without requiring the applications needing access to be root.
[https://man.sr.ht/~kennylevinsen/seatd/ Seatd] is a [[Seat manager|seat management]] daemon, that does everything it needs to do. Nothing more, nothing less. Depends only on libc. Seat management takes care of mediating access to shared devices (graphics, input), without requiring the applications needing access to be root.


When using [[elogind]], seatd is not required and viceversa. Don't add both to auto-start.
When using [[elogind]], seatd is not required and viceversa. Don't add both to auto-start.
{{note|Reading about seatd and elogind, you might get the impression that elogind is required for polkit. But seatd/polkit works fine if you use groups in the polkit rules, only for "subject.active" elogind is required. Which means with seatd you are restricted to YES or NO rules, no AUTH_ADMIN, since agents need POLKIT_IS_SUBJECT.}}


== Installation ==
== Installation ==
Line 15: Line 17:
== Configuration ==
== Configuration ==


Seatd is the light weight solution for [[sway]] and other [[Wayland]] compositors compared to [[elogind]]. When using seatd, few mandatory steps  are to be performed.
Ensure that [[XDG_RUNTIME_DIR]] is set before starting your Wayland compositor.


=== Configure XDG_RUNTIME_DIR ===
== See Also ==
Set the variable [[XDG_RUNTIME_DIR]]. This step is required for all [[Wayland]] compositors.
 
=== Environment variables ===
Additional environment variables needs to be set for all [[Wayland]] compositors to work properly with seatd:
* <code>XDG_SESSION_TYPE=wayland</code>
* <code>LIBSEAT_BACKEND=seatd</code>
* <code>XDG_CURRENT_DESKTOP=sway</code>
 
The variable <code>XDG_CURRENT_DESKTOP</code> must be suitably adjusted for other [[:Category:Compositor|Compositors]].
 
=== Seatd and Sway ===
 
When using seatd, [[sway]] must be started with above [[#Environment variables|Environment variables]] and [[D-Bus]] as shown below:
 
{{Cat|~/.profile|<nowiki>
# Environment variables required for seatd
export XDG_SESSION_TYPE=wayland
export LIBSEAT_BACKEND=seatd
export XDG_CURRENT_DESKTOP=sway
export XDG_VTNR=$(basename "$(tty)" | sed 's/tty//')
#Start sway with DBUS (only in TTY1)
if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then
    exec dbus-run-session sway
fi
</nowiki>}}
Ensure that your shell reads and executes the '''if''' condition in {{Path|.profile}}. Sway can also be launched with a [[Sway#Starting_sway|wrapper script]] with seatd. If using [[elogind]], then none of the above code snippets are required.


== See Also ==
* [https://man.sr.ht/~kennylevinsen/seatd/ seatd documentation]
* [https://man.sr.ht/~kennylevinsen/seatd/ seatd documentation]
* [https://github.com/swaywm/sway/wiki/Setting-environmental-variables sway wiki]
* [https://github.com/swaywm/sway/wiki/Setting-environmental-variables sway wiki]

Revision as of 03:34, 11 April 2025

Seatd is a seat management daemon, that does everything it needs to do. Nothing more, nothing less. Depends only on libc. Seat management takes care of mediating access to shared devices (graphics, input), without requiring the applications needing access to be root.

When using elogind, seatd is not required and viceversa. Don't add both to auto-start.

Note: Reading about seatd and elogind, you might get the impression that elogind is required for polkit. But seatd/polkit works fine if you use groups in the polkit rules, only for "subject.active" elogind is required. Which means with seatd you are restricted to YES or NO rules, no AUTH_ADMIN, since agents need POLKIT_IS_SUBJECT.

Installation

apk add seatd # install seatd rc-update add seatd # configure it to auto-start service seatd start # start it now adduser $USER seat # allow current user to access seatd

If you are already logged in as a $USER, you will need to relogin.

Configuration

Ensure that XDG_RUNTIME_DIR is set before starting your Wayland compositor.

See Also