Greetd

提供: ArchWiki
2022年2月24日 (木) 00:19時点におけるKgx (トーク | 投稿記録)による版 (一部翻訳)
ナビゲーションに移動 検索に移動

関連記事

greetd は、コンソールベースであれグラフィカルであれ、ユーザが何を起動したいのかを仮定しない、軽量で柔軟な login manager デーモンです。コンソールから起動できるスクリプトやプログラムはすべて greetd で起動できるので、 Wayland Compositors に特に適しています。greeter を起動して、他のディスプレイマネージャと同様にユーザセッションを開始することもできます。

インストール

greetdAUR または greetd-gitAUR パッケージを インストール します。

デフォルトの構成ファイルは /etc/greetd/config.toml です。PAM 固有のオプションは、 /etc/pam.d/greetd で設定する必要があります。

Greeters

ユーザーセッションを開始できるようにするには、greetd に greeter が必要です。いくつかの greeter が利用可能です:

greetd を開始する

有効化 して greetd.service を起動時に開始

参照 ディスプレイマネージャ#ディスプレイマネージャをロードする

Greeter configuration

Configuring the greeter run by greetd is done using the command option in the default_session section in /etc/greetd/config.toml. The included agreety greeter will be used if no changes are made. Also see #agreety.

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:

...
[default_session]
user = "another_user"
...

Make sure the ownership of the /etc/greetd directory is set accordingly.

agreety

This is the default greeter. It is launched by greetd with the configuration file set 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 sway.

gtkgreet

In order to run, gtkgreet needs a compositor. For the full experience, a compositor with wlr-layer-shell-unstable support is required but others can work. As such, it is recommended to use sway, but something like cage can also be used. Examples for both cage and sway are provided below.

In order to specify which login environments can be started by gtkgreet, list them in /etc/greetd/environments. For example:

sway
bash

You can also invoke gtkgreet with the -c mycommand parameter, replacing mycommand with the desired program (for example, gtkgreet -c bash or gtkgreet -c sway). Do so in the below compositor examples as desired.

Using cage

Install cage and set the command option as follows:

...
[default_session]
command = "cage gtkgreet"
...

Using sway

Install sway. When using Sway, it must be terminated once the user logs in. For that purpose, a specific configuration file must be created, 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, greetd must be set to start Sway with the configuration file above. Set the command option as follows:

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

wlgreet

In order to start wlgreet, a compositor with wlr-layer-shell-unstable is required. Follow the steps required to set up gtkgreet with Sway as described above but use the following for /etc/greetd/sway-config instead:

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

tuigreet does not require any special setup, just set the command option as follows:

...
[default_session]
command = "tuigreet --cmd sway"
...

tuigreet --help will display customization options.

ddlm

ddlm does not require any special setup, just set the command option as follows:

...
[default_session]
command = "ddlm --target sway"
...

qtgreet

In order to use qtgreet, you need a WLR based compositor (e.g. wayfireAUR, sway).

Using Wayfire

Install wayfireAUR and set the command option as follows:

...
[default_session]
command = "wayfire --config /etc/qtgreet/wayfire.ini"
...

The Wayfire configuration file referred to is included with qtgreet.

Enabling autologin

If you want a user to be logged in automatically, an initial_session section must be defined in /etc/greetd/config.toml:

...
[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.

If you do not want to use greetd and always want autologin to be enabled, see autologin.

See also