「Greetd」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(一部翻訳)
11行目: 11行目:
   
 
{{AUR|greetd}} または {{AUR|greetd-git}} パッケージを [[インストール]] します。
 
{{AUR|greetd}} または {{AUR|greetd-git}} パッケージを [[インストール]] します。
 
== 設定 ==
 
   
 
デフォルトの構成ファイルは {{ic|/etc/greetd/config.toml}} です。[[PAM]] 固有のオプションは、 {{ic|/etc/pam.d/greetd}} で設定する必要があります。
 
デフォルトの構成ファイルは {{ic|/etc/greetd/config.toml}} です。[[PAM]] 固有のオプションは、 {{ic|/etc/pam.d/greetd}} で設定する必要があります。
18行目: 16行目:
 
=== Greeters ===
 
=== Greeters ===
   
ユーザーセッションを開始できるようにするために、GreetD Greeter を起動きます。 いくつかの Greeters が利用可能です:
+
ユーザーセッションを開始できるようにするにgreetd greeter が必要です。いくつかの greeter が利用可能です:
   
* {{ic|agreety}} {{AUR|greetd}}/{{AUR|greetd-git}} パッケージで提供されている [[agetty]] に似たテキストベースの Greeter です。
+
* {{ic|agreety}} を使用します。(デフォルト、{{AUR|greetd}}/{{AUR|greetd-git}} に同梱)、[[agetty]] に似たテキストベースの greeter です。
* [https://git.sr.ht/~kennylevinsen/gtkgreet gtkgreet] ({{AUR|greet-gtkgreet}}/{{AUR|greet-gtkgreet-git}}で提供) [[GTK]] Greeter
+
* https://git.sr.ht/~kennylevinsen/dlm dlm] ({{AUR|greetd-dlm-git}} で提供), fbdev greeter です
* [https://git.sr.ht/~kennylevinsen/wlgreet wlgreet] ({{AUR|greet-wlgreet}}/{{AUR|greet-wlgreet-git}} によって提供) は、 [[Wayland]] Greeterです。
+
* [https://git.sr.ht/~kennylevinsen/gtkgreet gtkgreet] ({{AUR|greetd-gtkgreet}}/{{AUR|greetd-gtkgreet-git}} によって提供されています) [[GTK]] greeter です。
* [https://git.sr.ht/~kennylevinsen/dlm dlm] ({{AUR|greetd-dlm-git}} で提供) fbdev を使用するシンプルな greeter です。
+
* [https://git.sr.ht/~kennylevinsen/wlgreet wlgreet] (provided by {{AUR|greetd-wlgreet}}/{{AUR|greetd-wlgreet-git}}), a [[Wayland]] greeter.
* コンソール UI Greeter の [https://github.com/apognu/tuigreet tuigreet] ({{AUR|greetd-tuigreet}} によって提供)
+
* [https://github.com/apognu/tuigreet tuigreet] ({{AUR|greetd-tuigreet}} によって提供されています)、コンソール UI greeter です。
  +
* [https://github.com/deathowl/ddlm ddlm] ({{AUR|greetd-dlm-git}} によって提供されています), fbdev greeter です。{{ic|dlm}} の強化/拡張版です。
  +
* [https://gitlab.com/marcusbritanicus/QtGreet qtgreet] ({{AUR|greetd-qtgreet}} によって提供されています), [[Qt]] greeter です。
   
  +
== greetd を開始する ==
デフォルトでは、 greeter は {{ic|greeter}} ユーザーとして実行されます。これを変更するには、構成ファイルの {{ic|default_session}} セクションの {{ic|user}} オプションを編集し、''another_user'' を選択したユーザーに置き換えます。
 
   
  +
[[有効化]] して {{ic|greetd.service}} を起動時に開始
...
 
user = "another_user"
 
...
 
   
  +
参照 [[ディスプレイマネージャ#ディスプレイマネージャをロードする]]
{{ic|/etc/greetd}}ディレクトリの [https://wiki.archlinux.jp/index.php/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E3%83%91%E3%83%BC%E3%83%9F%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A8%E5%B1%9E%E6%80%A7 所有者を変更] が適切に設定されていることを確認します。
 
   
  +
== Greeter configuration ==
==== agreety ====
 
   
  +
Configuring the greeter run by greetd is done using the {{ic|command}} option in the {{ic|default_session}} section in {{ic|/etc/greetd/config.toml}}.
In order to launch a normal console session with agreety, edit the configuration file as follows:
 
  +
The included {{ic|agreety}} greeter will be used if no changes are made. Also see [[#agreety]].
...
 
  +
[default_session]
 
  +
By default, greeters are run as the {{ic|greeter}} user. This can be changed by editing the {{ic|user}} option in the {{ic|default_session}} section of the configuration file and replacing ''another_user'' with the chosen user:
command = "agreety --cmd $SHELL"
 
  +
...
 
  +
...
  +
[default_session]
  +
user = "another_user"
  +
...
  +
  +
Make sure the [[ownership]] of the {{ic|/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 {{ic|$SHELL}} in the example above with {{ic|sway}}.
 
agreety can launch any arbitrary command once a user logs in. For example, in order to start [[Sway]], replace {{ic|$SHELL}} in the example above with {{ic|sway}}.
   
==== gtkgreet ====
+
=== gtkgreet ===
   
In order to run, gtkgreet needs a compositor. It is recommended to use Sway, but {{pkg|cage}} can also be used. Make sure the compositor you would like to use is [[install]]ed before starting greetd.
+
In order to run, gtkgreet needs a compositor. For the full experience, a compositor with {{ic|wlr-layer-shell-unstable}} support is required but others can work. As such, it is recommended to use {{pkg|sway}}, but something like {{pkg|cage}} can also be used. Examples for both cage and sway are provided below.
If you want to use cage, your {{ic|[default_session]}} section should be:
 
...
 
[default_session]
 
command = "cage gtkgreet"
 
...
 
   
  +
In order to specify which login environments can be started by gtkgreet, list them in {{ic|/etc/greetd/environments}}.
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 {{ic|/etc/greetd/sway-config}}, with the following content:
 
  +
For example:
# `-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/*
 
   
  +
sway
Then, gtkgreeter must be set to start Sway with the configuration file above:
 
  +
bash
...
 
[default_session]
 
command = "sway --config /etc/greetd/sway-config"
 
...
 
   
  +
You can also invoke gtkgreet with the {{ic|-c ''mycommand''}} parameter, replacing ''mycommand'' with the desired program (for example, {{ic|gtkgreet -c bash}} or {{ic|gtkgreet -c sway}}). Do so in the below compositor examples as desired.
In order to specify which login environments can be started by gtkgreet, list them in {{ic|/etc/greetd/environments}}. For example:
 
sway
 
bash
 
   
  +
==== Using cage ====
Instead, you can also invoke gtkgreet with the {{ic|-c ''mycommand''}} parameter, replacing ''mycommand'' with the desired program (for example, {{ic|bash}} or {{ic|sway}}) either in {{ic|/etc/greetd/config.toml}}, if you use Cage, or in {{ic|/etc/greetd/sway-config}}, if you use Sway.
 
   
  +
[[Install]] {{pkg|cage}} and set the {{ic|command}} option as follows:
==== wlgreet ====
 
   
  +
...
In order for greetd to start wlgreet, follow the steps required to set up gtkgreet with Sway as [[#gtkgreet|described above]] with the following {{ic|/etc/greetd/sway-config}} instead:
 
  +
[default_session]
exec "wlgreet --command sway; swaymsg exit"
 
  +
command = "cage gtkgreet"
 
  +
...
bindsym Mod4+shift+e exec swaynag \
 
  +
-t warning \
 
  +
==== Using sway ====
-m 'What do you want to do?' \
 
  +
-b 'Poweroff' 'systemctl poweroff' \
 
  +
[[Install]] {{pkg|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 {{ic|/etc/greetd/sway-config}}, with the following content:
-b 'Reboot' 'systemctl reboot'
 
  +
 
  +
{{bc|
include /etc/sway/config.d/*
 
  +
# `-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 {{ic|command}} option as follows:
  +
  +
...
  +
[default_session]
  +
command = "sway --config /etc/greetd/sway-config"
  +
...
  +
  +
=== wlgreet ===
  +
  +
In order to start wlgreet, a compositor with {{ic|wlr-layer-shell-unstable}} is required. Follow the steps required to set up gtkgreet with Sway as [[#Using sway|described above]] but use the following for {{ic|/etc/greetd/sway-config}} instead:
  +
  +
{{bc|
  +
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 ===
   
tuigreet does not require any special setup, just refer to it in {{ic|/etc/greetd/config.toml}}:
+
tuigreet does not require any special setup, just set the {{ic|command}} option as follows:
   
 
...
 
...
101行目: 129行目:
 
{{ic|tuigreet --help}} will display customization options.
 
{{ic|tuigreet --help}} will display customization options.
   
=== Autologin ===
+
=== ddlm ===
If you want a user to be logged in automatically, an {{ic|initial session}} must be defined in the configuration file:
 
   
  +
ddlm does not require any special setup, just set the {{ic|command}} option as follows:
[default_session]
 
command = "cage gtkgreet"
 
 
[initial_session]
 
command = "sway"
 
user = "myuser"
 
   
  +
...
The ''command'' option may contain the name of any executable file.
 
  +
[default_session]
In the example above, Sway will be started by ''myuser'' at boot and gtkgreet will be launched after the user logs out.
 
  +
command = "ddlm --target sway"
  +
...
   
  +
=== qtgreet ===
If you don't want to use greetd and always want autologin to be enabled, see [https://git.sr.ht/~kennylevinsen/autologin autologin].
 
  +
  +
In order to use qtgreet, you need a WLR based compositor (e.g. {{AUR|wayfire}}, {{Pkg|sway}}).
  +
  +
==== Using Wayfire ====
  +
  +
[[Install]] {{AUR|wayfire}} and set the {{ic|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 {{ic|initial_session}} section must be defined in {{ic|/etc/greetd/config.toml}}:
  +
  +
...
  +
[initial_session]
  +
command = "sway"
  +
user = "''myuser''"
  +
...
   
  +
The {{ic|command}} option may contain the name of any executable file. In the example above, Sway will be started by {{ic|''myuser''}} at boot and ''gtkgreet'' will be launched after the user logs out.
== Starting greetd at boot ==
 
   
  +
If you do not want to use ''greetd'' and always want autologin to be enabled, see [https://git.sr.ht/~kennylevinsen/autologin autologin].
[[Enable]] {{ic|greetd.service}} for greetd to be started at boot.
 
   
 
== See also ==
 
== See also ==
   
* [https://git.sr.ht/~kennylevinsen/greetd/ greetd project page]
+
* [https://sr.ht/~kennylevinsen/greetd/ greetd project page]
  +
* [https://git.sr.ht/~kennylevinsen/greetd/ greetd source code]
 
* [https://man.sr.ht/%7Ekennylevinsen/greetd/ greetd wiki]
 
* [https://man.sr.ht/%7Ekennylevinsen/greetd/ greetd wiki]

2022年2月24日 (木) 00:19時点における版

関連記事

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