User:Librecat/gtkgreet with Cage backend
Introduction
GTKGreet can be used with the gui-wm/cage compositor to avoid having to install a larger wayland compositor or duplicating a configuration file for one and being a wayland kiosk its better suited for running a login greeter
Installation
Unmasking
first unmask cage from testing if you accept the risks
/etc/portage/package.accept_keywords/cage-gtkgreet:
gui-wm/cage
gui-apps/gtkgreet
Emerge
then emerge the packages
emerge --ask gui-wm/cage gui-apps/gtkgreet
Configuration
Making the wrapper script
then make a wrapper script with your settings as environment variables for cage to respect
/usr/local/bin/cage-gtkgreet.sh
# set keyboard layout(only set and export the needed variables)
#XKB_DEFAULT_RULES=""
XKB_DEFAULT_MODEL="en"
XKB_DEFAULT_LAYOUT="pc104"
#XKB_DEFAULT_VARIANT=""
#XKB_DEFAULT_OPTIONS=""
GTK_THEME="Adwaita-dark"
export XKB_DEFAULT_MODEL XKB_DEFAULT_LAYOUT GTK_THEME
# start cage with gtkgreet as the only program
# -s allows you to switch tty's
/usr/bin/cage -s -- /usr/bin/gtkgreet
then make the script executable:
chmod +x /usr/local/bin/cage-gtkgreet.sh
Setting the wrapper script
then set it as the default session in greetd: /etc/greetd/config.toml:
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 7
# The default session, also known as the greeter.
[default_session]
# `agreety` is the bundled agetty/login-lookalike. You can replace `/bin/sh`
# with whatever you want started, such as `sway`.
command = "cage-gtkgreet.sh"
# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "greetd"
testing it
make sure it works before adding display-manager to default runlevel and thus starting cage on every boot
See also/ Sources
https://github.com/cage-kiosk/cage/wiki/Configuration
and https://man.sr.ht/~kennylevinsen/greetd/
without these documentation this article wouldnt have been possible