Ubuntu Core custom Plymouth theme

Hi @relvin

I have successfully added a custom theme in a few different gadget snaps.

Essentially. you need to add your custom theme content via a part in your existing gadget snap, and you just need to add it to the correct path. Once you have done that, assuming you have also set kernel parmas quiet splash via the gadget too, it should work if the theme is valid.

Don’t forget, the only supported plymouth plugin type is scripts [ script.so ], and you must be using at least Ubuntu Core 22.

For example, say you have a git repo with your theme content, something like:

./themes/theme-foo/splash/plymouth/themes/vendor/vendor.plymouth
./themes/theme-foo/splash/plymouth/themes/vendor/vendor.script
./themes/theme-foo/splash/plymouth/themes/vendor/something-1.png
./themes/theme-foo/splash/plymouth/themes/vendor/something-2.png
~~~8<~~~
./themes/theme-bar/splash/plymouth/themes/vendor/vendor.plymouth
./themes/theme-bar/splash/plymouth/themes/vendor/vendor.script
./themes/theme-bar/splash/plymouth/themes/vendor/otherthing-1.png
./themes/theme-bar/splash/plymouth/themes/vendor/otherthing-2.png

You scripts [ vendor.script ] are up to you of course, and your plymouth configs [ vendor.plymouth ] , might look something like as follows:

[Plymouth Theme]
Name=Foo Theme
Description=The Theme Of Foo
ModuleName=script

[script]
ImageDir=/run/mnt/gadget/splash/plymouth/themes/vendor/
ScriptFile=/run/mnt/gadget/splash/plymouth/themes/vendor/vendor.script

Add a part to your gadget to include one of the themes from the repo, similar to the following:

  boot-splash:
    plugin: dump
    source: {git-url-to-splash-theme}
    organize:
      themes/theme-foo/splash: splash
    stage:
      - splash

Then build and test.

If you want to test outside of boot/shutdown, you can do the following:

In one shell:

plymouthd --no-daemon --debug

In another shell:

plymouth --show-splash
plymouth display-message --text="Just testing"

Hope that helps.

Cheers, Just

2 Likes