Skip to content

June 2, 2009

How to easily experiment your new usplash theme from a terminal

by Joe Kuan

ubuntulogoWhen you have designed your own new splash theme, it is unlikely the first time it looks exactly the way you want it. However, it is inconceivable to test it by building the LiveCD and running from it. It is too time consuming and not practical.    

So here is a quick tutorial on how to launch your new theme from a terminal and show it on your console screen without creating the LiveCD. That means you can keep changing your design and the components of the splash screen such as progress bar, message box, color, positioning, etc.

Assume that you have read the USplashCustomizationHowto document and you have compiled your own theme .so file. On your development box, do the following two steps just to get the usplash link to your own theme. Once this step is done, your don’t have to do it again when you rebuild the theme library.

sudo update-alternatives --install /usr/lib/usplash/usplash-artwork.so usplash-artwork.so
<path to yourimage-splash.so> 55
sudo update-alternatives --config usplash-artwork.so

Run usplash from a terminal

You need to have another computer to ssh the development box, so that you can easily stop/start and change the splash screen look. First, starts with two remote terminals sshed to the development box. On the first one, starts up the usplash to load up the resolution that your splash theme supports. E.g

root@ubuntu:~/livecd# usplash -x 1024 -y 768

You should see your new splash image appeared on your console screen. Here is the screenshot of my console display.
itrinegy-splash1

Then on the second remote terminal, you must run the following command first to stop the usplash to exit automatically because usplash has a default timeout. The command will set the timeout indefinitely, see man page of usplash_write.

root@ubuntu:~/livecd# usplash_write "TIMEOUT 0"

Suppose you need to adjust the position of progress bar, you edit the theme code and rebuild theme.so file. You need to restart usplash to see the new effect. You can simply press Ctrl-C on the terminal running usplash or issue the command: usplash_write “QUIT”, then launch the usplash again.

Experiment console messages on usplash

1. Change color
Suppose you want to try different color on the console messages in usplash. First, you need to get the index values from the colormap of the splash image. To do that, you can use GIMP to load the splash PNG image and select Colors -> Maps -> Rearrange Colormap. You should see all the index values of the colormap.
colormap
Make sure the PNG image has 8 bits colormap. If not, have a look at my other blog, hopefully that will help.

Then change the theme property, compile and restart the usplash. Run the command

root@ubuntu:~/livecd# usplash_write "TEXT-URGENT Hello"

You should see a text box with a message ‘Hello’. Here is a screenshot of the console display.
itrinegy-splash2

2. Show Timeout
Suppose you would like to write a shell script to show count down or progress messages inside the text box. Here is an example of shutdown in 10 secs 

usplash_write "TEXT-URGENT Shutdown in 10 secs"
usplash_write "VERBOSE on"
for i in 9 8 7 6 5 4 3 2 1 0
do
   usplash_write "STATUS $i"
   sleep 1
done

Here is the screenshot of the message box with status message. You can configure the position and color of the status message inside the theme.c file.

splash message box

Have fun.

 

I work for iTrinegy and here are my other technical blogs

Read more from Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments

%d bloggers like this: