Install Theme
I have created theme as you wanted with a faded Ubuntu logo (moreover I have added an animation of the Ubuntu logo. Hope you'd like it :-P )
Screenshot
Want to see it live?
Go to http://www.youtube.com/watch?v=zPo50gM3txU
Where can you get this theme?
I have uploaded it to Mediafire cloud here.
How do you install it?
Download from the above link, save it on your Desktop, then issue these commands one by one.
Please replace /lib/plymouth/themes
with /usr/share/plymouth/themes
in the commands, if you are on 16.04 or later.
cd ~/Desktop/
tar -xf ubuntufaded.tar
sudo cp -r ubuntu-faded-screen '/lib/plymouth/themes'
sudo rm '/lib/plymouth/themes/default.plymouth'
sudo ln -s '/lib/plymouth/themes/ubuntu-faded-screen/ubuntu-faded-screen.plymouth' '/lib/plymouth/themes/default.plymouth'
sudo update-initramfs -u
How to check it?
- Restart Ubuntu and you'll see a nice animation while booting up and
shutting down. OR
Copy the whole command below and paste it into a terminal and hit enter. (You will probably need to install a package: sudo apt-get install plymouth-x11
)
sudo plymouthd --debug --debug-file=/tmp/plymouth-debug-out ; sudo plymouth --show-splash ; for ((I=0;I<10;I++)); do sleep 1 ; sudo plymouth --update=event$I ; done ; sudo plymouth --quit
How to create a Plymouth theme yourself
Plymouth Scripting Language is very similar to C or JavaScript. If you know these languages, it'll be very easy to create Plymouth scripts yourself.
Let's start with basics like operators, looping, comments, etc. Three type of comments are supported.
# comment like in bash
// single line comment like in C
/* block comments */
Statements are terminated with a semicolon, e.g.
foo = 10;
Statement blocks can be created with curly brackets, e.g.
{
foo = 10;
z = foo + foo;
}
The supported operators are +
, -
, *
, /
, %
.
Shorthand assignment operators are also supported +=, -=, *=,
etc.
Unary operators are also supported, e.g.
foo *= ++z;
+
is used for concatenation e.g.
foo = "Jun" + 7; # here foo is "Jun7"
Comparison operator example:
x = (3 >= 1); # assign 1 to x because it's true
y = ("foo" == "bar"); # assign 0 to y because it's false
Conditional operations and looping:
if (foo > 4)
{
foo--;
z = 1;
}
else
z = 0;
while (foo--)
z *= foo;
&&
, ||
, !
are also supported.
if ( foo > 0 && foo <4 )
This may be new to many readers: hashes, similar to arrays. Hashes can be created by accessing their contents using dot
or [ ]
brackets, e.g.
foo.a = 5;
x = foo["a"] ; # x equals to 5
Use the fun
keyword to define function, e.g.
fun animator (param1, param2, param3)
{
if (param1 == param2)
return param2;
else
return param3;
}
The two basic Plymouth objects
Image
To create a new Image, give the filename of an image within the theme directory to Image()
. Remember, only .png files are supported. For example:
background = Image ("black.png");
To show a text message you must create an Image
of the text. (This might surprise you.) For example:
text_message_image = Image.Text("I love Ubuntu");
Width and height can be found using GetWidth()
and GetHeight()
; for example:
image_area = background.GetWidth() * background.GetHeight();
One can rotate or change the size of an Image; for example:
down_image = logo_image.Rotate (3.1415); # Image can be Rotated. Parameter to Rotate is the angle in radians
fat_image = background.Scale ( background.GetWidth() * 4 , background.GetHeight () ) # make the image four times the width
Sprite
Use Sprite
to place an Image
on screen.
Creating a Sprite
:
first_sprite = Sprite ();
first_sprite.SetImage (background);
Or by supplying image to its constructor,
first_sprite = Sprite (background);
How to set different the sprite to different positions on screen (x,y,z):
first_sprite.SetX (300); # put at x=300
first_sprite.SetY (200); # put at y=200
background.SetZ(-20);
foreground.SetZ(50);
Or you can set all at once with SetPosition()
:
first_sprite.Setposition(300, 200, 50) # put at x=300, y=200, z=50
Changing opacity:
faded_sprite.SetOpacity (0.3);
invisible_sprite.SetOpacity (0);
Some miscellaneous methods used are:
Window.GetWidth();
Window.GetHeight();
Window.SetBackgroundTopColor (0.5, 0, 0); # RGB values between 0 to 1.
Window.SetBackgroundBottomColor (0.4, 0.3, 0.6);
Plymouth.GetMode(); # returns a string of one of: "boot", "shutdown", "suspend", "resume" or unknown.
etc.
Predefined Functions
Plymouth.SetRefreshFunction (function); # Calling Plymouth.SetRefreshFunction with a function will set that function to be called up to 50 times every second
Plymouth.SetBootProgressFunction(); # function is called with two numbers, time spent booting so far and the progress (between 0 and 1)
Plymouth.SetRootMountedFunction(); # function is called when a new root is mounted
Plymouth.SetKeyboardInputFunction(); # function is called with a string containing a new character entered on the keyboard
Plymouth.SetUpdateStatusFunction(); # function is called with the new boot status string
Plymouth.SetDisplayPasswordFunction(); # function is called when the display should display a password dialogue. First param is prompt string, the second is the number of bullets.
Plymouth.SetDisplayQuestionFunction(); # function is called when the display should display a question dialogue. First param is prompt string, the second is the entry contents.
Plymouth.SetDisplayNormalFunction(); # function is called when the display should return to normal
Plymouth.SetMessageFunction(); # function is called when new message should be displayed. First arg is message to display.
Mathematical Functions
Math.Abs()
Math.Min()
Math.Pi()
Math.Cos()
Math.Random()
Math.Int()
etc.
It is better to modify an existing script than to start from scratch.
Open up .script
file from my uploaded theme and try to understand what it does. A fantastic guide can be found here.
I'm sure you'll learn this. It isn't hard. Let me know if you need any help.
Hope it'd help you create one yourself.
Answer to Roshan George's Comment :
Is it possible to replace the purple colour with an image as background in the default Plymouth theme names "ubuntu-logo" ?
background = Image ("your-image.png");
sprite = Sprite (background.Scale (Window.GetWidth(), Window.GetHeight()));
sprite.SetX (0); # put at x=0
sprite.SetY (0); # put at y=0
You might need to add sprite.SetZ (-10);
You should remove
Window.SetBackgroundTopColor (p, q, r);
Window.SetBackgroundBottomColor (a, b, c);
where p, q, r, a, b, c
are some values.
More links
Best Answer
Note: The Ubuntu Builder project has been discontinued.
Creating a custom 12.04 CD with Gnome-Classic using Ubuntu-Builder
(for now, this is specific to Karthik's needs; I will update answer later with more general/Unity-specific stuff)
1. Get Ubuntu Builder and your source ISO
Ubuntu Builder automates many of the preliminary steps that had to be done by hand (mount ISO, extract squashfs, create chroot, etc.) It gives you Synaptic and a "graphical" chroot as well (Unity UI).
Add the PPA to install Ubuntu Builder:
Also download the Ubuntu Desktop ISO you're planning to work with.
2. Ubuntu Builder Basics
Start Ubuntu Builder from the Launcher. I recommend you set all three fields to "Ubuntu" (like the actual LiveCD), because setting custom fields led to Software Center crashing. When you install, you can choose your own username, machine name, etc. as always.
Load your ISO; I loaded the 64-bit with the Local Disk option, although Ubuntu Builder should be able to download the ISO if you want it to.
Console
gives you a CLI chroot, whileDesktop
gives you a graphical one!, i.e. a LiveCD session itself (this one may take a while to load). Note that theSelect DE/WM
does an incomplete job sometimes, so it's better to install via apt-get/Synaptic.3. Updating, adding Gnome Classic and other package management
sources.list
with the button (or via the console) to add your own mirrors, ppas, etc.Let's start with:
gnome-shell
to pull in indicators, etc.), Samba and SSH:4. Customization 1: Files, configs and removing the top-panel
Replace Samba configuration file (from your own system terminal, i.e. outside chroot!)
Put Firefox shortcut on desktop:
Copy custom shortcuts and folders to Desktop (from outside chroot!)
Set
gnome-classic
as the default shell:Remove the top Gnome-Classic panel and move top-items to the bottom-panel:
Move the indicators to the bottom right, just to the left of the Workspace Switcher, by modifying the bolded value for the italicized parameters as below:
Remove the "Show Desktop" button from the bottom left; I prefer the Start Menu to be the first thing there, you can leave it or move it to the bottom right, etc. Delete these lines:
Save and exit.
5. Customization 2: Backgrounds and Themes
Disable the login screen (lightdm) from "copying" the desktop background and other changes:
nano /usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml
false
:Change the default wallpaper; here, we'll set it to the included "Tie My Boat" (
/usr/share/backgrounds/Tie_My_Boat_by_Ray_García.jpg
):nano /usr/share/glib-2.0/schemas/10_gsettings-desktop-schemas.gschema.override
, and change the below line to the path for your file:Change the theme to Radiance
Important: Compile the modified schemas!
6. Build, test and install!
Press the
Build
button in Ubuntu Builder to begin building the custom Live-CD ISO. UB automatically handles the cleanup, etc. that previously had to be done manually.The ISO can be found in
/home/ubuntu-builder
; you can test it using the built-in QEMU, or in another virtual machine..23
kernel), with Unity and Gnome 3D still available if the user wishes to, so that's pretty good for a customization! :)The following should result:
After bootup, you get the "Try Ubuntu" or "Install Ubuntu" option:
Clicking "Try" gets us our custom desktop!
And logging out (login with
ubuntu
, blank password) shows that the login wallpaper is kept at the default:Installer does not crash upon Timezone selection:
Select username, etc. for install:
Installed login screen:
Installed desktop: