「plymouth を設定する」
https://qiita.com/nanbuwks/items/7a2635a181cf97fcf974
では、既存のテーマを選択し、有効にしましたが、
簡単なものを自分で作ってみます。
環境
- Debian Testing ( Debian 13 : 2024/07/09時点 )
準備
先の記事の通り、必要なパッケージのインストールや、plymouth が動く環境の作成をしておきます。
作るテーマ
- 止め絵
- アニメーションは行わない
- 作るのが簡単なもの
既存のテーマを調査
まずは theme にどんなものがあるか見てみます。
# cd /usr/share/plymouth/themes
# ls -R
.:
bgrt fade-in joy softwaves spinner
debian-theme futureprototype lines solar text
details glow moonlight spacefun tribar
emerald homeworld script spinfinity
./bgrt:
bgrt.plymouth
./details:
details.plymouth
./emerald:
Emerald_plymouth.svg emerald.script logo+emerald.png password_dot16.png
debian.png glow.png logo+emerald.svg password_field.png
emerald.plymouth glow.xcf password_dot.png password_field16.png
./fade-in:
bullet.png entry.png fade-in.plymouth lock.png star.png
.
.
.
script の書き方がよくわからなかったので、 script の無いテーマを元にカスタマイズしようかな・・・・・と思いましたが、よくわかりませんでした。 script の無いテーマはどこかのデフォルトスクリプトが作用しているのかな?
Web記事を参考にする
「Plymouth Theme Customization | Baeldung on Linux」
https://www.baeldung.com/linux/plymouth-themes-splash-screen
こちらの記事では、
https://github.com/barskern/plymouth-theme-simple-image
を元にシンプルな止め絵を表示するテーマを作っています。
それを元に作業をしてみました。
ダウンロード
$ git clone https://github.com/barskern/plymouth-theme-simple-image
$ cd plymouth-theme-simple-image
中に入っている image.png を、好きな画像に入れ替えてみました。
それに伴い、 simple-image.script 中の以下の箇所を書き換えます。
image = Image("image.png");
pos_x = Window.GetWidth()/2 - image.GetWidth()/2;
pos_y = Window.GetHeight()/2 - image.GetHeight()/2;
.
.
.
↓
image = Image("logo-text-version-256.png");
pos_x = Window.GetWidth()/2 - image.GetWidth()/2;
pos_y = Window.GetHeight()/2 - image.GetHeight()/2;
.
.
.
次に、simple-image.plymouth ファイルの以下の箇所を書き換えて、好きな名前を付けます。
[Plymouth Theme]
Name=Arch Linux Simple Image
テーマ名を決めます。テーマディレクトリ名=plymouthファイル名=テーマ名 というルールがあるようです。
ここではplymouthファイル名が simple-image だったので、それに合わせました。
$ cd ..
$ mv plymouth-theme-simple-image simple-image
テーマをインストールし、変更を反映します。
# cp -a plymouth-theme-simple-image /usr/share/plymouth/themes
# plymouth-set-default-theme simple-image
# update-initramfs -u
再起動してみます。