Greetd: Difference between revisions
Prabuanand (talk | contribs) m (fixed typos and re arranged sentence) |
Prabuanand (talk | contribs) (rewritten the instruction to address issues caused by missing XDG_RUNTIME_DIR for seatd) |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:greetd}} | {{DISPLAYTITLE:greetd}} | ||
[https://git.sr.ht/~kennylevinsen/greetd greetd] is a minimal and flexible login manager daemon that makes no assumptions about what you want to launch | [https://git.sr.ht/~kennylevinsen/greetd greetd] is a minimal and flexible login manager daemon that makes no assumptions about what you want to launch. It is recommended to read the [https://man.sr.ht/~kennylevinsen/greetd/ greetd wiki] first. | ||
== Installation == | == Installation == | ||
greetd needs to be combined with a greeter. You can find a list of available greeters here: {{pkg|greetd-*}}. This page shows the | greetd needs to be combined with a greeter. You can find a list of available greeters here: {{pkg|greetd-*}}. This page shows the graphical greeter gtkgreet which is packaged as {{pkg|greetd-gtkgreet}}. Install the main package and the greeter: | ||
{{cmd|# apk add {{pkg|greetd}} {{pkg|greetd-gtkgreet}} }} | {{cmd|# apk add {{pkg|greetd}} {{pkg|greetd-gtkgreet}} }} | ||
Line 16: | Line 13: | ||
== Configuration == | == Configuration == | ||
Graphical greeters like gtkgreet require either [[seatd]] or [[elogind]]. | Graphical greeters like gtkgreet require either [[seatd]] or [[elogind]]. | ||
If using cage, the config file appears as follows: | If using cage, the config file appears as follows: | ||
Line 28: | Line 20: | ||
user = "greetd" | user = "greetd" | ||
</nowiki>}} | </nowiki>}} | ||
Instead of {{pkg|cage}}, [[sway]] or any | |||
{{Cat|/etc/greetd/config.toml|<nowiki>[default_session] | Instead of {{pkg|cage}}, [[sway]] or any other wayland compositor can be used by setting the greetd config file: {{Cat|/etc/greetd/config.toml|<nowiki>[default_session] | ||
command = "sway --config /etc/greetd/sway-config" | command = "sway --config /etc/greetd/sway-config" | ||
user = "greetd" | user = "greetd" | ||
</nowiki>}} | </nowiki>}} | ||
{{ | When [[seatd]] is used, following additional configuration is required. | ||
# For graphical greeters like gtkgreet, the user '''greetd''' needs the <code>seatd</code> group:{{cmd|# adduser greetd seat}} | |||
# Append <code>rc_need=seatd</code> in the following file:{{Cat|/etc/conf.d/greetd|... | |||
<nowiki>rc_need=seatd | |||
</nowiki>}} | |||
# Ensure that [[Wayland#XDG_RUNTIME_DIR|XDG_RUNTIME_DIR]] is set. If [[Wayland#Use mkrundir|mkrundir]] is used, a simple wrapper script named <code>sway-greeted</Code> can be created as follows: {{Cat|/usr/local/bin/sway-greetd|#!/bin/sh | |||
export XDG_RUNTIME_DIR{{=}}$(mkrundir) | |||
exec sway $@}} | |||
# Make it executable using {{Codeline|<Code># chmod +x /usr/local/bin/sway-greetd</Code>}} and replace <code>sway</code> by <code>sway-greetd</code> in the greetd config file:{{Cat|/etc/greetd/config.toml|<nowiki>[default_session] | |||
command = "sway-greetd --config /etc/greetd/sway-config" | |||
user = "greetd" | |||
</nowiki>}} | </nowiki>}} | ||
Create a dedicated sway config file that runs the greeter and terminates when it dies: {{cat|/etc/greetd/sway-config|<nowiki>exec "gtkgreet -l -s /etc/greetd/gtkgreet.css; swaymsg exit" | |||
</nowiki>}} | |||
{{Cat|/etc/greetd/environments|<nowiki>sway-run | Edit/create the list of login environments for gtkgreet, which is by default read from {{Path|/etc/greetd/environments}}. Instead of listing <Code>sway</Code> a [[Sway#Starting_sway|wrapper script]] like <Code>sway-run</Code> can be used.{{Cat|/etc/greetd/environments|<nowiki>sway-run | ||
</nowiki>}} | </nowiki>}} | ||
Revision as of 07:24, 21 December 2024
greetd is a minimal and flexible login manager daemon that makes no assumptions about what you want to launch. It is recommended to read the greetd wiki first.
Installation
greetd needs to be combined with a greeter. You can find a list of available greeters here: greetd-*. This page shows the graphical greeter gtkgreet which is packaged as greetd-gtkgreet. Install the main package and the greeter:
# apk add greetd greetd-gtkgreet
Install a lightweight wayland compositor to be used with greetd login session.(If using Sway, no need for cage).
# apk add cage
Configuration
Graphical greeters like gtkgreet require either seatd or elogind.
If using cage, the config file appears as follows:
Contents of /etc/greetd/config.toml
Instead of cage, sway or any other wayland compositor can be used by setting the greetd config file:
Contents of /etc/greetd/config.toml
When seatd is used, following additional configuration is required.
- For graphical greeters like gtkgreet, the user greetd needs the
seatd
group:# adduser greetd seat
- Append
rc_need=seatd
in the following file:Contents of /etc/conf.d/greetd
... rc_need=seatd - Ensure that XDG_RUNTIME_DIR is set. If mkrundir is used, a simple wrapper script named
sway-greeted
can be created as follows:Contents of /usr/local/bin/sway-greetd
#!/bin/sh export XDG_RUNTIME_DIR=$(mkrundir) exec sway $@ - Make it executable using
# chmod +x /usr/local/bin/sway-greetd
and replacesway
bysway-greetd
in the greetd config file:Contents of /etc/greetd/config.toml
[default_session] command = "sway-greetd --config /etc/greetd/sway-config" user = "greetd"
Create a dedicated sway config file that runs the greeter and terminates when it dies:
Contents of /etc/greetd/sway-config
Edit/create the list of login environments for gtkgreet, which is by default read from /etc/greetd/environments. Instead of listing sway
a wrapper script like sway-run
can be used.
Contents of /etc/greetd/environments
Once you have completed the above configuration, Enable and start greetd:
# rc-update add greetd # rc-service greetd start
For text based greeters you want to make sure that vt
is set in:
Contents of /etc/greetd/config.toml