Seatd: Difference between revisions

From Alpine Linux
No edit summary
(moved XDG_RUNTIME_DIR to Prerequisites section)
 
(28 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Seatd is a [[seat manager]] and provides user sessions (mostly compositors) with access to input and output devices.
{{Verified|0}}[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.


See [https://man.sr.ht/~kennylevinsen/seatd/ the seatd documentation] for further details.
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.
== Prerequisites ==


= Installation =
* Seatd requires that [[XDG_RUNTIME_DIR]] is set before starting your [[Wayland]] compositor.


{{Cmd|apk add {{Pkg|seatd}}      # install seatd
== Installation ==
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 <code>$USER</code>, you will need to relogin.
Install the {{Pkg|seatd}} package:{{Cmd|# apk add {{Pkg|seatd}}}}


= Seatd and Sway =
== Configuration ==


seatd is the light weight solution for [[sway]] compared to [[elogind]]. To start [[sway]] manually with seatd following three things are necessary:
=== Service management ===
To add the {{ic|seatd}} service to auto-start using [[OpenRC]]: {{Cmd|<nowiki># rc-update add seatd
# rc-service seatd start </nowiki>}}


== Configuring XDG_RUNTIME_DIR ==
To add the currently logged in user to {{ic|seat}} group issue the command: {{Cmd|$ doas adduser $USER seat}}


Set the variable [[XDG_RUNTIME_DIR]].
If you are already logged in as a <code>$USER</code>, you will need to relogin.
 
== Environement variables ==
Additional environement variables needs to be set properly for [[sway]] to work properly, if started manually.
 
{{Cat|~/.profile|<nowiki>
#Environment variables required for sway to work with seatd
export XDG_SESSION_TYPE=wayland
export XDG_CURRENT_DESKTOP=sway
export LIBSEAT_BACKEND=seatd
</nowiki>}}
 
If you are planning to use [[Greetd]], a light weight login manager instead of {{Pkg|gdm}} or [[SDDM]] the below section does not apply. However the above two sections are still needed.
 
== start sway+seatd manually with D-Bus ==


When using seatd, [[sway]] must be started with [[D-Bus]] so that [[PipeWire]] and other such [[D-Bus]] dependenant services can work without issues.
=== Polkit ===


{{Cat|~/.profile|<nowiki>
[[Polkit#Using polkit with seatd|Polkit]] can be configured and used for authentication with seatd with certain limitations. Since seatd doesn't provide detailed session tracking, polkit rules that rely on these properties (e.g., subject.active, subject.local) cannot be evaluated. Hence graphical, session-aware [[Polkit#Authentication agents|polkit authentication agents]] are not supported.
#Start sway with DBUS (Manual method)  
if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then
    exec dbus-run-session sway -d 2> ~/sway_error.log
fi
</nowiki>}}


Ensure that your shell reads and executes the above if condition in .profile. {{Pkg|bash}} works with the above code. For other shells, make necessary changes.  
Refer to [[Polkit#Example1|sample polkit rule file]] that works with seatd.


== See also ==


If you are using [[elogind]] then the above code snippets are not required.
* [https://man.sr.ht/~kennylevinsen/seatd/ seatd documentation]
* [https://github.com/swaywm/sway/wiki/Setting-environmental-variables sway wiki]


[[Category:Desktop]]
[[Category:Seat_manager]]
[[Category:Seat_manager]]
[[Category:Sway]]
[[Category:Wayland]]

Latest revision as of 12:15, 16 August 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.

Prerequisites

Installation

Install the seatd package:

# apk add seatd

Configuration

Service management

To add the seatd service to auto-start using OpenRC:

# rc-update add seatd # rc-service seatd start

To add the currently logged in user to seat group issue the command:

$ doas adduser $USER seat

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

Polkit

Polkit can be configured and used for authentication with seatd with certain limitations. Since seatd doesn't provide detailed session tracking, polkit rules that rely on these properties (e.g., subject.active, subject.local) cannot be evaluated. Hence graphical, session-aware polkit authentication agents are not supported.

Refer to sample polkit rule file that works with seatd.

See also