Greetd: Difference between revisions

From Alpine Linux
m (Added category)
m (fixed typos and re arranged sentence)
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:


This article focuses on alpine specific instructions. It is recommended to read the [https://man.sr.ht/~kennylevinsen/greetd/ greetd wiki] first.
This article focuses on alpine specific instructions. 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-*}}. Install the main package and the greeter you selected:
greetd needs to be combined with a greeter. You can find a list of available greeters here: {{pkg|greetd-*}}. This page shows the grpahical 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}} }}
Install a lightweight wayland compositor to be used with greetd login session.(If using [[Sway]], no need for {{pkg|cage}}).  
Let us use {{pkg|greetd-gtkgreet}} as an example:
 
{{cmd|# apk add {{pkg|greetd-gtkgreet}}}}
Install a lightweight wayland compositor to be used with greetd login session.  
{{cmd|# apk add {{pkg|cage}}}}
{{cmd|# apk add {{pkg|cage}}}}


== Configuration ==
== Configuration ==


Graphical greeters (like gtkgreet) require [[seatd]] or [[elogind]].  When you use <code>seatd</code> with a graphical greeter it needs the <code>seatd</code> group:
Graphical greeters like gtkgreet require either [[seatd]] or [[elogind]].  When you use <code>seatd</code> with a graphical greeter it needs the <code>seatd</code> group:
{{cmd|# adduser greetd seat}}   
{{cmd|# adduser greetd seat}}   


Depending on whether [[seatd]] or [[elogind]] is used, edit the following file:
Depending on whether [[seatd]] or [[elogind]] is used, set <code>rc_need=seatd</code>or <code>rc_need=elogind</code> in the following file:
{{Cat|/etc/conf.d/greetd|<nowiki>rc_need=seatd
{{Cat|/etc/conf.d/greetd|<nowiki>rc_need=seatd
</nowiki>}}
</nowiki>}}


Instead of cage, [[sway]] or any [[wayland]] compositor can be used
If using cage, the config file appears as follows:
{{Cat|/etc/greetd/config.toml|<nowiki>[default_session]
{{Cat|/etc/greetd/config.toml|<nowiki>[default_session]
command = "cage -s -- gtkgreet"
command = "cage -s -- gtkgreet"
user = "greetd"
user = "greetd"
</nowiki>}}
Instead of {{pkg|cage}}, [[sway]] or any [[wayland]] compositor can be used:
{{Cat|/etc/greetd/config.toml|<nowiki>[default_session]
command = "sway --config /etc/greetd/sway-config"
user = "greetd"
</nowiki>}}
To use sway, create a dedicated sway config 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>}}
</nowiki>}}


To start sway session for the user, you might want to start a [[D-Bus#D-Bus_session|D-Bus session]] when the greetd session is started.  
Edit gtkgreet list of login environments, which is by default read from {{Path|/etc/greetd/environments}}. The below example shows Sway  [[Sway#Starting_sway|wrapper script]].


{{Cat|/etc/greetd/environments|<nowiki># Launch Sway with a D-Bus server available, use:
{{Cat|/etc/greetd/environments|<nowiki>sway-run
dbus-run-session -- sway
</nowiki>}}
</nowiki>}}



Latest revision as of 07:31, 11 December 2024


greetd is a minimal and flexible login manager daemon that makes no assumptions about what you want to launch.

This article focuses on alpine specific instructions. 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 grpahical 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. When you use seatd with a graphical greeter it needs the seatd group:

# adduser greetd seat

Depending on whether seatd or elogind is used, set rc_need=seatdor rc_need=elogind in the following file:

Contents of /etc/conf.d/greetd

rc_need=seatd

If using cage, the config file appears as follows:

Contents of /etc/greetd/config.toml

[default_session] command = "cage -s -- gtkgreet" user = "greetd"

Instead of cage, sway or any wayland compositor can be used:

Contents of /etc/greetd/config.toml

[default_session] command = "sway --config /etc/greetd/sway-config" user = "greetd"

To use sway, create a dedicated sway config that runs the greeter, and terminates when it dies:

Contents of /etc/greetd/sway-config

exec "gtkgreet -l -s /etc/greetd/gtkgreet.css; swaymsg exit"

Edit gtkgreet list of login environments, which is by default read from /etc/greetd/environments. The below example shows Sway wrapper script.

Contents of /etc/greetd/environments

sway-run

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

[terminal] # The VT to run the greeter on. Can be "next", "current" or a number # designating the VT. vt = 7

See Also