greetd is a minimal, agnostic and flexible login manager daemon which doesn't make assumptions about what the user wants to launch, should it be console-based or graphical. Any script or program which can be started from the console may be launched by greetd, which makes it particularly suitable for Wayland compositors. It can also launch a greeter to start user sessions, like any other display manager.
Install the AUR or AUR packages.
The default configuration file is
/etc/greetd/config.toml. PAM-specific options should be set in
In order to allow user sessions to be started, greetd can launch a greeter. Several greeters are available:
agreety, a text-based greeter similar to agetty which is provided by the AUR/ AUR package.
- gtkgreet (provided by AUR/ AUR), a GTK greeter.
- wlgreet (provided by by AUR/ AUR), a Wayland greeter.
- dlm (provided by AUR), a simple greeter which uses fbdev.
- tuigreet (provided by AUR), a console UI greeter.
By default, greeters are run as the
greeter user. This can be changed by editing the
user option in the
default_session section of the configuration file and replacing another_user with the chosen user:
... user = "another_user" ...
Make sure the ownership of the
/etc/greetd directory is set accordingly.
In order to launch a normal console session with agreety, edit the configuration file as follows:
... [default_session] command = "agreety --cmd $SHELL" ...
agreety can launch any arbitrary command once a user logs in. For example, in order to start Sway, replace
$SHELL in the example above with
In order to run, gtkgreet needs a compositor. It is recommended to use Sway, but installed before starting greetd.
If you want to use cage, your
[default_session] section should be:
... [default_session] command = "cage gtkgreet" ...
If you want to use Sway, the greeter must be terminated once the user logs in. For that purpose, a specific configuration file must be created for Sway, for example in
/etc/greetd/sway-config, with the following content:
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. exec "gtkgreet -l; swaymsg exit" bindsym Mod4+shift+e exec swaynag \ -t warning \ -m 'What do you want to do?' \ -b 'Poweroff' 'systemctl poweroff' \ -b 'Reboot' 'systemctl reboot' include /etc/sway/config.d/*
Then, gtkgreeter must be set to start Sway with the configuration file above:
... [default_session] command = "sway --config /etc/greetd/sway-config" ...
In order to specify which sessions can be started by gtkgreet, list them in
/etc/greetd/environments. For example:
Instead, you can also invoke gtkgreet with the
-c mycommand parameter, replacing mycommand with the desired program (for example,
sway) either in
/etc/greetd/config.toml, if you use Cage, or in
/etc/greetd/sway-config, if you use Sway.
In order for greetd to start wlgreet, follow the steps required to set up gtkgreet with Sway as described above with the following
exec "wlgreet --command sway; swaymsg exit" bindsym Mod4+shift+e exec swaynag \ -t warning \ -m 'What do you want to do?' \ -b 'Poweroff' 'systemctl poweroff' \ -b 'Reboot' 'systemctl reboot' include /etc/sway/config.d/*
tuigreet does not require any special setup, just refer to it in
... [default_session] command = "tuigreet --cmd sway" ...
See the customization option with
If you want a user to be logged in automatically, an
initial session must be defined in the configuration file:
[default_session] command = "cage gtkgreet" [initial_session] command = "sway" user = "myuser"
The command option may contain the name of any executable file. In the example above, Sway will be started by myuser at boot and gtkgreet will be launched after the user logs out.
Starting greetd at boot
greetd.service for greetd to be started at boot.