Greetd

提供: ArchWiki
2021年6月8日 (火) 23:23時点におけるKgx (トーク | 投稿記録)による版 (→‎Configuration: 翻訳)
ナビゲーションに移動 検索に移動

関連記事

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

インストール

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

設定

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

Greeters

ユーザーセッションを開始できるようにするために、GreetD は Greeter を起動できます。 いくつかの Greeters が利用可能です:

デフォルトでは、 greeter は greeter ユーザーとして実行されます。これを変更するには、構成ファイルの default_session セクションの user オプションを編集し、another_user を選択したユーザーに置き換えます。

 ...
 user = "another_user"
 ...

/etc/greetdディレクトリの 所有者を変更 が適切に設定されていることを確認します。

agreety

In order to launch a normal console session with agreety, edit the configuration file 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. It is recommended to use Sway, but cage can also be used. Make sure the compositor you would like to use is installed before starting greetd. If you want to use cage, your [default_session] section should be:

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

If you want to use Sway, the greeter must be terminated once the user logs in. For that purpose, a specific configuration file must be created for Sway, 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, gtkgreeter must be set to start Sway with the configuration file above:

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

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

 sway
 bash

Instead, you can also invoke gtkgreet with the -c mycommand parameter, replacing mycommand with the desired program (for example, bash or sway) either in /etc/greetd/config.toml, if you use Cage, or in /etc/greetd/sway-config, if you use Sway.

wlgreet

In order for greetd to start wlgreet, follow the steps required to set up gtkgreet with Sway as described above with the following /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 refer to it in /etc/greetd/config.toml:

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

tuigreet --help will display customization options.

Autologin

If you want a user to be logged in automatically, an initial session must be defined in the configuration file:

 [default_session]
 command = "cage gtkgreet"
 
 [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 don't want to use greetd and always want autologin to be enabled, see autologin.

Starting greetd at boot

Enable greetd.service for greetd to be started at boot.

See also