LoginSignup
0
0

More than 1 year has passed since last update.

WMをLightDM+ Web Greeterから起動しよう

Last updated at Posted at 2022-12-12

願望

こんなWindowsXPログイン画面や

WelcomeXP

こんなかっちょいい画面で

lightdm-webkit-theme-litarvan

ログインしたくない??????

したい!!!!!!!!!!!!!

いざ設定

インストール

LightDM

ディストーションごとのパッケージマネージャを使ってインストールするだけ

$ sudo apt install lightdm  # Ubuntu

$ yay -S lightdm # arch Linux

web-greeter

LightDMはまだ更新が続いているが、web greeterの方はアーカイブになってしまいましたが、
別作者がフォークして開発を継続してくれています。
https://jezerm.github.io/web-greeter-page/

正直、サポートしているテーマの数で比べるとアーカイブ化した方が多いですが、本記事ではjezerm氏が作成してる方のweb-greeterを使用します。

12/13日現在で使用可能なのが、Python製Web-greeterとElectronで書かれたnody-greeterの二種類だけだが、
性能が変わるだけで、使用可能なテーマ・設定項目はさほど変わらない。環境に合わせて使用する事

インストールはREADMEに書いてある通りに実行すれば終わる。完了すると、以下のフォルダが現れるはず。

$ ls /usr/share/web-greeter/themes

このフォルダの中に使用したいテーマをディレクトリごと突っ込む。この際、突っ込んたディレクトリの名前が後ほど設定するテーマ名になるので覚えておくこと。

設定

Lightdm

LightDMをインストールしても、DMを切り替えないとLightDMが起動してくれない。
なので、systemdを使用して切り替える。

sudo systemctl enable lightdm.service
# おそらく、ここで
# Failed to enable unit: File /etc/systemd/system/display-manager.service already exists and is a symlink to /usr/lib/systemd/system/{DM}.service.
# 的なのがでると思う。そうしたら、{DM}.serviceを一旦disableしてからlightdmを有効化する。

$ sudo systemctl disable {DM}.service
$ sudo systemctl enable lightdm.service

LightDMの起動設定は完了したので、次は設定ファイルを編集していく。

LightDMの設定ファイルは/etc/lightdm/lightdm.confにある。
重要なのはgreeter-sessionの項目。

#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
greeter-session=web-greeter # この項目をnody-greeter もしくは web-greeterに変更する
#greeter-hide-users=false
#greeter-allow-guest=true

Web greeter

あとは、web-greeter側の設定です。

web-greeterの設定ファイルは同ディレクトリの/etc/lightdm/web-greeter.ymlにある。
このファイルのthemeを先程themeディレクトリに突っ込んだテーマのディレクトリ名を入れる

greeter:
    debug_mode: False
    detect_theme_errors: True
    screensaver_timeout: 300
    secure_mode: True
    theme: dracula # 使用したいテーマ名
    icon_theme:
    time_language: ja

これでX-WindowのWMを使用している人は終わりです。お疲れ様でした。

Wayland用

waylandセッションの人はLightDMの設定を少し設定を変更する必要があります。
arch Linuxだとなったのですが、LightDMのsession-wrapperがXesssionとなっています。

$ cat /etc/lightdm/lightdm.conf | grep session-wrapper
session-wrapper = Wrapper script to run session with
session-wrapper=/etc/lightdm/Xsession

当然、Xsessionなわけがないのでwayland用の設定に変更します。
Xsession自体はX用WMの設定をしてくれるシェルスクリプトなのですが、waylandにはそんなもの必要ない(タイル型はそうでした)ので適当に書きます。

Wsession
#!/bin/sh
#
# LightDM wrapper to run around Wayland sessions.

echo "Running Wayland session wrapper"

sleep 1 # おまじない https://github.com/canonical/lightdm/issues/63
exec $@

このファイルを適当な場所に保存して保存したファイルのパスをlightdmのsession-wrapperの項目に書きましょう。

そうすればwaylandでも動くはずです。

皆様、よきLinuxライフを

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0