5

I put ubuntu-spinner-logo PT on my old Ubuntu 19.04 PC, how can I increse duration of it, PT last untill boot ends,but spinning logo last for aprox. 15s and PC need about 40s to boot up. I found ubuntu-spinner-logo.script in:

usr/share/plymouth/themes/ubuntu-spinner-logo/

but I do not know how to modify it, or am I allowed to modify it due to licence of it. Thank you on your time.

1
  • 1
    In the Linux world you can modify pretty much all the source code you want to modify. So licensing issues are the the least of your challenges. Knowing how to modify it is your greatest challenge. That said I think this challenge should be how to increase Plymouth duration without thinking ahead of time that source code needs to be modified. Commented Sep 15, 2019 at 20:03

2 Answers 2

2

This will do the job:

Firstly, run the following command in the terminal to create and edit a shell script file in your home directory:

nano ~/SweetDreams.sh

Secondly, copy and paste the following code into the editor, replace USERNAME with your username and save it by pressing Ctrl + X then press Y then press Enter :

#!/bin/bash

x=1

while [ $x -le 1 ]

do

        echo "Sleeping" | tee -a  /home/USERNAME/SweetDreams.log

        sleep 40

        echo "Waking" | tee -a  /home/USERNAME/SweetDreams.log

        x=$(( $x + 1 ))

done

Modify the wait time by changing the 40 after sleep. This time is in seconds.

Thirdly, make the shell script file executable by running the following command in the terminal:

chmod +x ~/SweetDreams.sh

Fourthly, create and edit a custom systemd service to run the shell script at boot by running the following command in the terminal:

sudo nano /etc/systemd/system/SweetDreams.service 

Fifthly, copy and paste the following code into the editor, replace USERNAME with your username and save it by pressing Ctrl + X then press Y then press Enter :

[Unit]
Description=Sweet Dreams
Before=gdm.service

[Service]
Type=oneshot
ExecStart=/home/USERNAME/SweetDreams.sh

[Install]
WantedBy=multi-user.target

Sixthly, start the service by running the following command in the terminal:

sudo systemctl start SweetDreams

Seventhly, enable the service by running the following command in the terminal:

sudo systemctl enable SweetDreams

Finally, reboot your system.


If for any reason you want to undo this solution, please run the following commands in the terminal one after the other in the same sequence below:

  1. sudo systemctl stop SweetDreams
  2. sudo systemctl disable SweetDreams
  3. sudo rm /etc/systemd/system/SweetDreams.service
  4. rm ~/SweetDreams.sh
  5. sudo rm ~/SweetDreams.log

Short explaination:

Plymouth is made to wait for system services. The above SweetDreams service will force plymouth to wait for any period of time you choose. Problem solved.

1
  • On my Raspberry Pi with Debian Bullseye the script does print to the log file but it doesnt effect the boot splash duration which only shows up for a fraction of a second.
    – ramiwi
    Commented Jun 7, 2022 at 11:27
1

Very nice, I have made a slight modification to the timer function that might be useful to others who come across this post as i did.

Case Use You have a custom plymouth file but your operating system boots too fast to see it.

#!/usr/bin/env bash
count=0
while [[ "$count" -lt 20 ]];
    do
        read -t 1 -n 1 k <&1
            if [[ "$k" -lt 20 ]];
        then
            break
        else
            sleep 1s
        fi
    count=$(( "$count" + 1 ))
done

This gives the added option of stopping early by pressing q or waiting the full time.

You must log in to answer this question.