A clean and customizable GTK-based greetd greeter written in Rust using Relm4. This is meant to be run under a Wayland compositor (like Sway).
It is based on
Max Moser's LightDM Elephant greeter,
which is based on
Matt Shultz's Fischer's example LightDM greeter.
These screenshots use the Canta GTK theme in dark mode with the Roboto font. All screenshots are provided under the CC-BY-SA-4.0 license.
- Shows a dropdown list of existing users and X11/Wayland sessions
- Allows manual entry of username and session command
- Remembers the last authenticated user
- Automatically selects the last used session per user
- Can also skip selecting the user/session and choose the last user and their last used session.
- Allows setting environment variables for created sessions
- Supports customizing:
- Background image
- Clock
- GTK theme
- Dark mode
- Icon theme
- Cursor theme
- Cursor blink on/off
- Font
- Allows changing reboot & poweroff commands for different init systems
- Supports custom CSS files for further customizations
- Respects
XDG_DATA_DIRSenvironment variable - Respects fields
HiddenandNoDisplayin session files - Picks up the first found session with the same name and in the same type (X11/Wayland). This allows for overriding system-provided session files.
- Demo mode to run ReGreet without greetd for easier development.
- Rust 1.85.0+ (for compilation only)
- greetd
- GTK 4.16+
- D-Bus
- AccountsService
- Glycin (for background images; supported formats depend on installed plugins)
- GStreamer (for background animated images & video; supported formats depend on installed plugins)
- A Wayland compositor (such as Cage or Sway or Hyprland)
Note: Please make sure you have all requirements installed, as having a greetd greeter constantly failing isn't as much fun as it sounds.
ReGreet is available as greetd-regreet in the official Arch Linux repositories, and as greetd-regreet-git in the AUR. Note that I only maintain the AUR package, and the package in the Arch repos is maintained by someone else.
Install the AUR package either by cloning the AUR repository and running
makepkg, or by using your favourite AUR helper:
paru -S greetd-regreet-gitInstall the package in the Arch repos as follows:
pacman -S greetd-regreetFor a minimal config, add programs.regreet.enable = true; in your NixOS
configuration file. For users who want to configure more, they can see all the
options of the module by searching for regreet on
NixOS Search.
First, the greeter must be compiled using Cargo:
cargo build --releaseThe compilation process also configures the greeter to look for or use certain directories. These can be changed by setting the values of certain environment variables. These are:
| Environment Variable | Default | Use |
|---|---|---|
| GREETD_CONFIG_DIR | /etc/greetd |
The configuration directory used by greetd |
| STATE_DIR | /var/lib/regreet |
The directory used to store the ReGreet state/cache |
| LOG_DIR | /var/log/regreet |
The directory used to store logs |
| SESSION_DIRS | /usr/share/xsessions:/usr/share/wayland-sessions |
A colon (:) separated list of directories where the greeter looks for session files |
| X11_CMD_PREFIX | startx /usr/bin/env |
The default command prefix for X11 sessions to launch the X server (see this explanation on Reddit) |
| REBOOT_CMD | reboot |
The default command used to reboot the system |
| POWEROFF_CMD | poweroff |
The default command used to shut down the system |
The greeter can be installed by copying the file target/release/regreet to
/usr/bin (or similar directories like /bin).
Optionally, to set up the log and state directories using systemd-tmpfiles, do either of the following:
- Copy the configuration given in
systemd-tmpfiles.conf to
/etc/tmpfiles.d/regreet.confor/usr/lib/tmpfiles.d/regreet.conf. - Run the
systemd-tmpfilesCLI:systemd-tmpfiles --create "$PWD/systemd-tmpfiles.conf"
Edit the greetd config file (/etc/greetd/config.toml) to set ReGreet with a
Wayland compositor as the default session, and then restart greetd to use the
new config. Below you will find some examples of different Wayland compositors.
Set the greetd config file to:
[default_session]
command = "dbus-run-session cage -s -mlast -d -- regreet"
user = "greeter"The -s argument enables VT switching in cage (0.1.2 and newer only), which is
highly recommended to prevent locking yourself out. The -mlast argument tells
Cage to use the last-connected monitor only, which is useful since ReGreet is a
single-monitor application. The -d argument tells Cage to avoid using
client-side decorations for ReGreet's application window. The dbus-run-session
command as a prefix is optional, but multiple users report that it helps solve
startup delays.
Create a Sway config file (in a path such as /etc/greetd/sway-config) as
follows:
exec "regreet; swaymsg exit"
include /etc/sway/config.d/*
Then, set Sway to use this config (whose path is shown here as
/path/to/custom/sway/config) as the default greetd session:
[default_session]
command = "dbus-run-session sway --config /path/to/custom/sway/config"
user = "greeter"Create a Hyprland config file (in a path such as /etc/greetd/hyprland.lua) as
follows:
hl.on("hyprland.start", function()
hl.exec_cmd("regreet; hyprctl dispatch 'hl.dsp.exit()'")
end)
hl.config({
misc = {
disable_hyprland_logo = true,
disable_splash_rendering = true,
disable_hyprland_guiutils_check = true,
},
})If your Hyprland version doesn't support Lua configs, create instead a legacy
Hyprlang config file (in a path such as /etc/greetd/hyprland.conf) as follows:
exec-once = regreet; hyprctl dispatch exit
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
disable_hyprland_guiutils_check = true
}
Then, set Hyprland to use this config (whose path is shown here as
/path/to/custom/hyprland/config) as the default greetd session:
[default_session]
command = "dbus-run-session start-hyprland -- -c /path/to/custom/hyprland/config"
user = "greeter"Create a KDL config file (in a path such as /etc/greetd/niri.kdl) as follows:
spawn-sh-at-startup "regreet; niri msg action quit --skip-confirmation"
hotkey-overlay {
skip-at-startup
}
cursor {
// Change the theme and size of the cursor as well as set the
// `XCURSOR_THEME` and `XCURSOR_SIZE` env variables.
xcursor-theme "catppuccin-mocha-red-cursors"
}Then, set Niri to use this config (whose path is shown here as
/path/to/custom/niri/config) as the default greetd session:
[default_session]
command = "dbus-run-session niri --config /path/to/custom/niri/config"
user = "greeter"Set the greetd config file to:
[default_session]
command = "dbus-run-session gamescope --backend drm --force-windows-fullscreen -- regreet"
user = "greeter"The configuration file must be in the TOML format. By
default, it is named regreet.toml, and located in the greetd configuration
directory specified during compilation (/etc/greetd/ by default). You can use
a config file in a different location with the --config argument as follows:
regreet --config /path/to/custom/regreet/config.tomlA sample configuration is provided along with sample values for all available
options in regreet.sample.toml. Currently, the
following can be configured:
- Background image (supported formats depend on your installed GStreamer plugins)
- How the background image fits the screen
- Environment variables for created sessions
- Greeting message
- Clock
- GTK theme
- Dark mode
- Icon theme
- Cursor theme
- Cursor blink on/off
- Font
- Reboot command
- Shut down command
- X11 command prefix (see this explanation on Reddit)
NOTE: For configuring other essential features, such as the keyboard layout/mapping, the choice of monitor to use, etc., please check out the configuration options for the wayland compositor that you are using to run ReGreet. For example, if you use Cage, check out the Cage wiki. If you use Sway, check out the Sway wiki. If you use Hyprland, check out the Hyprland wiki.
ReGreet supports loading CSS files to act as a custom global stylesheet. This enables one to do further customizations above what ReGreet supports through the config file.
By default, the custom CSS file is named regreet.css, and located in the
greetd configuration directory specified during compilation (/etc/greetd/ by
default). To load a custom CSS stylesheet from a different location, pass the
-s or --style CLI argument as follows:
regreet --style /path/to/custom.cssPlease refer to the GTK4 docs on CSS in GTK and GTK CSS Properties to learn how to style a GTK4 app using CSS. For a general reference on CSS, please refer to the MDN web docs.
Tip: You might want to use demo mode with the GTK Inspector to explore the CSS hierarchy and test out your CSS before making it permanent.
Tip: If you're using an LLM to help you create a basic CSS file, give it all the links above in this subsection along with this file from the ReGreet source code: src/gui/templates.rs.
The default reboot and shut down commands use the reboot and poweroff
binaries, which are present on most Linux systems. However, since the
recommended way of using ReGreet is to avoid running it as root, the
reboot/poweroff commands might not work on systems where superuser access is
needed to run these commands. In this case, if there is another command to
reboot or shut down the system without superuser access, these commands can be
set in the config file under the [commands] section.
For example, to use loginctl reboot as the reboot command, use the following
config:
[commands]
reboot = [ "loginctl", "reboot" ]Here, each command needs to be separated into a list containing the main command, followed by individual arguments.
These commands can also be specified during compilation using the REBOOT_CMD
and POWEROFF_CMD environment variables.
The state is are stored in /var/lib/regreet/state.toml (configurable during
installation). It contains the last authenticated user and the last used session
per user, which are automatically selected on next login. If the greeter is
unable to write to this file, then it reverts to the default behaviour.
By default, the logs are stored in /var/log/regreet/log (configurable during
installation). You can use a log file in a different location with the --logs
argument as follows:
regreet --logs /path/to/custom/regreet/logsOnce the log file reaches a limit, it is compressed and rotated to log.X.gz in
the same directory, where X is the index of the log file. The higher the
index, the older the log file. After reaching a limit, the oldest log file is
removed.
If the greeter is unable to write to this file or create files in the log
directory, then it logs to stdout. You can also print the logs to stdout in
addition to the log file, with the --verbose argument as follows:
regreet --verboseThe recommended configuration is to run greetd greeters as a separate user
(greeter in the above examples). This can lead to insufficient permissions for
either creating the state/log directories, or writing to them. To make use of
the caching and logging features, please create the directories manually with
the correct permissions, if not done during installation with systemd-tmpfiles.
It seems that dbus-run-session has solved startup delays, but if you find that
ReGreet takes too much time to start up, you may be affected by this:
swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start.
See this link for the fix.
As another option, you can disable portals by exporting environment variables
for the Wayland compositor launched for ReGreet. Simply prepend
env GTK_USE_PORTAL=0 GDK_DEBUG=no-portals to the start of the default session
command in greetd.toml. For example, with Cage, the session command would be:
[default_session]
command = "env GTK_USE_PORTAL=0 GDK_DEBUG=no-portals dbus-run-session cage -s -mlast -- regreet"If using Hyprland, you can instead append the following lines to the Hyprland config for ReGreet:
env = GTK_USE_PORTAL,0
env = GDK_DEBUG,no-portals
pre-commit is used for managing hooks that run before each commit (such as clippy), to ensure code quality. Thus, this needs to be set up only when one intends to commit changes to git.
Firstly, install pre-commit itself. Next, install pre-commit hooks:
pre-commit installNow, pre-commit should ensure that the code passes all linters locally before committing. This will save time when creating PRs, since these linters also run in CI, and thus fail code that hasn't been linted well.
To aid development, a "demo" mode is included within ReGreet that runs ReGreet independent of greetd. Simply run ReGreet as follows:
regreet --demoSince the demo mode doesn't use greetd, authentication is done using hardcoded credentials within the codebase. These credentials are logged with the warning log-level, so that you don't have to read the source code.
This repository uses REUSE to document licenses. Each file either has a header containing copyright and license information, or has an entry in the TOML file at REUSE.toml. The license files that are used in this project can be found in the LICENSES directory.
Individual contributors are grouped under "The ReGreet Authors" for copyright attribution purposes. A full list of contributors is available on the GitHub contributors page.
A copy of the GPL-3.0-or-later license is placed in LICENSE, to signify that it constitutes the majority of the codebase, and for compatibility with GitHub.





