3

Will it be possible to change the default 20.04 Plymouth 3-curve spinner animation/rotation that is displayed during login with our own image ?

Update : As per instructions from the comment by UnKNOWn

Possible spinner replacement, 256x256px for ease of use

enter image description here

Added GIF

enter image description here

user227495
  • 3,951
  • 16
  • 52
  • 98
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/119696/discussion-on-question-by-user227495-change-the-default-plymouth-spinner-in-20-0). – Mitch Feb 13 '21 at 09:04

1 Answers1

4

in Default installation of Ubuntu 20.04, bgrt Plymouth theme is used.

/usr/share/plymouth/themes/bgrt/bgrt.plymouth

this theme has below (some of the content only) content from the file /usr/share/plymouth/themes/bgrt/bgrt.plymouth

[Plymouth Theme]
Name=BGRT
Description=Jimmac's spinner theme using the ACPI BGRT graphics as background
ModuleName=two-step

The line ModuleName=two-step has something hard coded opposed to other plymouth themes which uses Script.

Some of the content from another plymouth theme

[Plymouth Theme]
Name=Script
Description=Script example plugin.
ModuleName=script

[script]
ImageDir=/usr/share/plymouth/themes/script
ScriptFile=/usr/share/plymouth/themes/script/script.script

Since your main goal is to stay with the default Plymouth theme shipped with Ubuntu 20.04, we need to concentrate on the MouduleName=two-step

I have tried to get the configurations/guides/specs of this Module named "two-step" but without success..

this Ask Ubuntu post https://askubuntu.com/a/85329/739431 might help something to understand Moudule named two-step.

from trial and errors with the default plymouth theme bgrt /usr/share/plymouth/themes/bgrt/ and with the help of above Ask Ubuntu post..

I did following steps to have custom Images to play as spinner..

1. copy the spinner theme with below command

sudo cp -r /usr/share/plymouth/themes/spinner /usr/share/plymouth/themes/myplymouththeme

rename spinner.playmouth file to myplymouththeme.plymouth with below command

sudo mv /usr/share/plymouth/themes/myplymouththeme/spinner.plymouth /usr/share/plymouth/themes/myplymouththeme/myplymouththeme.plymouth

Open the file myplymouththeme.plymouth with below command and edit the contents as per your requirement.

sudo -H gedit /usr/share/plymouth/themes/myplymouththeme/myplymouththeme.plymouth

Some of the lines which needs to edit.. I have already edited.

ImageDir=/usr/share/plymouth/themes/myplymouththeme

HorizontalAlignment=.5
VerticalAlignment=.7
WatermarkHorizontalAlignment=.5
WatermarkVerticalAlignment=.96

Image directory is self explanative as we are going to keep our images in this.
HorAlignment .5 is center for the spinner.
VerAlignment .7 is from top of the screen towards bottom, you can reduce this to increase gap between watermark and spinner.
Watermarks are also similar to above explanation.

The image names seems to have throbber- prefix to its numbering like throbber-01.png throbber02.png etc.. Delete all the images with animation* and throbber* and then put your images in the said directory. seems it accepts only png files as Images.

Ok, configuration is done..

to use this theme, create a new file playmouthd.conf with below command

sudo install -D /dev/null /etc/plymouth/plymouthd.conf

and Open the file with below command and add the lines..

sudo -H gedit /etc/plymouth/plymouthd.conf

lines

[Daemon]
Theme=myplymouththeme
ShowDelay=0

You can change the watermark.png with your preferred Image (keep a eye on default watermark.png pic size)

Reboot and See the Changes..

While you are in Desktop you can test the plymouth theme by logging in to two tty's

In one tty, run the below command

sudo plymouthd --debug --tty=`tty` --no-daemon

In other tty, run the below command

sudo plymouth --show-splash

when you run --show-splash it automatically switches to other tty and shows the plymouth, to quit it.. open the other tty where you ran --show-splash command and run below command

sudo plymouth --quit

enter image description here

enter image description here

you can configure to not to show the Firmware Background, by editing the file myplymouththeme.plymouth with the line UseFirmwareBackground=

[boot-up]
UseEndAnimation=false
UseFirmwareBackground=false

enter image description here

Edit:

It seems tweaking an external script to your needs is easy. Here is the zip file https://github.com/PRATAP-KUMAR/LinkOnly/blob/main/peppermint.zip tweaked from https://www.cinnamon-look.org/p/1471802/

to use peppermint theme, keep the extracted directory peppermint in /usr/share/plymouth/themes/ then edit plymouthd.conf file.

sudo -H gedit /etc/plymouth/plymouthd.conf

with below content..

[Daemon]
Theme=peppermint
ShowDelay=0

enter image description here

Reboot..

Tweaking few things in this peppermint.script may reach your requirements.

Example Lines from the .script file

#--------------------------------------Background functions --------------------------

fun centered_spinner(filename) {
    object.image = Image (filename);
    object.sprite = Sprite ();
    object.sprite.SetImage (object.image);
    object.width = object.image.GetWidth ();
    object.height = object.image.GetHeight ();
    object.x = Window.GetX () + Window.GetWidth () / 2 - object.width  / 2; # Edit to Align as per your requirment
    object.y = Window.GetY () + Window.GetHeight () - object.height / 2 - 100; # Edit to Align as per your requirment
    object.sprite.SetX (object.x);
    object.sprite.SetY (object.y);

    return object;
}

fun centered_logo(filename) {
    object.image = Image (filename);
    object.sprite = Sprite ();
    object.sprite.SetImage (object.image);
    object.width = object.image.GetWidth ();
    object.height = object.image.GetHeight ();
    object.x = Window.GetX () + Window.GetWidth () / 2 - object.width  / 2; # Edit to Align as per your requirment
    object.y = Window.GetY () + Window.GetHeight () - object.height / 2 - 40; # Edit to Align as per your requirment
    object.sprite.SetX (object.x);
    object.sprite.SetY (object.y);

    return object;
}

--

#Animation settings
spinner.rot.steps = 8; # steps for 1 full rotation
spinner.rot.delay = 0.05; # timing in secs

--

#    Window.SetBackgroundTopColor (rt, gt, bt);                  #gradient - darker at the top of screen
    Window.SetBackgroundTopColor (0, 0, 0);                      #no gradient
    Window.SetBackgroundBottomColor (0, 0, 0);

enter image description here

PRATAP
  • 21,989
  • 8
  • 59
  • 121
  • 1
    Thanks. Kindly allow me a few hours to do this. – user227495 Feb 13 '21 at 08:56
  • 1
    Corrected a typo. I hope you don't mind. I am enjoying this *plymouth theme on the operation table* :) **+1** – Raffa Feb 13 '21 at 14:03
  • Hi, I have a doubt. Can we use less than 30 images ? Also the size of spinner images in default are 38x38, can we use larger ? – user227495 Feb 13 '21 at 14:45
  • ok, I was wondering whether I should use 512px images, 10 numbers which features blur. In the end, they will be 10 PNG images with names throbber-1.png to throbber-10.png. Shall I try ? Thanks – user227495 Feb 13 '21 at 14:51
  • One more, if you don't mind. If I go ahead and make a simple spinner replacement, I can try the whole process again and make a better theme, right ? This is not a one time method ? Thanks :) – user227495 Feb 13 '21 at 15:00
  • The Github repo which you have shared ? – user227495 Feb 13 '21 at 15:03
  • ok. I already started with 1 st method. I am not sure whether I should stop – user227495 Feb 13 '21 at 15:07
  • 1
    First of all, I would like to thank you. It works great during spinner replacement. But at some point, my monitor went to power save mode. Is it related to the absence of `animated` PNGs. Not sure. Also, there was some image bleeding like the 2nd animation in the answer. Then I tried using a static image with different amounts of blur. It is working nice. I need to work on it to fine-tune it. In the static image experiment too there is some session which was blank. Probably the `animation` PNG bug (?). – user227495 Feb 13 '21 at 16:40
  • 1
    Sure. I will try it. Probably tomorrow with a clear mind. I will check the `animated` images. Thanks for all the help :) – user227495 Feb 13 '21 at 16:56
  • @UnKNOWn there is some issue with the bigger image than what is in the repo. There must be some way to allow users a bigger spinner and move it near the centre of the screen like the first method. Only suggesting. My attempt with the default image and 20 steps is the smoothest one so far. :) – user227495 Feb 14 '21 at 10:09
  • 1
    If my above answer was complex, for the record, both methods are working for me. – user227495 Feb 14 '21 at 10:20