
Change the Ubuntu 22.04 Boot & Login Screen Logo: A Complete Guide
Personalizing your operating system is a great way to make it truly your own, whether for personal flair or for corporate branding. One of the most visible customizations you can make in Ubuntu 22.04 is changing the default boot and login screen logos. This guide will walk you through the precise steps to replace the default Ubuntu branding with your own custom images.
While the process is straightforward, it involves modifying system files. It is crucial to back up any files before you alter them. This ensures you can easily revert to the default settings if anything goes wrong.
Customizing the Ubuntu Boot Screen (Plymouth) Logo
The initial screen you see when your system boots up, often featuring a logo and a loading spinner, is managed by a service called Plymouth. To change this logo, you will replace the default image file with your own.
1. Prepare Your Custom Logo
First, create the image you want to use. For the best results, your logo should be a PNG file with a transparent background. The default logo is named ubuntu-logo.png, and we will use this same filename for our replacement to keep things simple.
2. Back Up the Original Logo
Before making any changes, open your terminal and create a backup of the original Plymouth logo. This is a critical safety step.
sudo cp /usr/share/plymouth/ubuntu-logo.png /usr/share/plymouth/ubuntu-logo.png.bak
3. Replace the Logo File
Next, copy your custom logo into the Plymouth directory, overwriting the original. Assuming your new logo is named ubuntu-logo.png and is located in your Downloads folder, the command would be:
sudo cp ~/Downloads/ubuntu-logo.png /usr/share/plymouth/ubuntu-logo.png
4. Update the initramfs
Simply replacing the image is not enough. You must update the initial RAM file system (initramfs) for the changes to be applied during the next boot sequence. This command rebuilds the boot environment to include your new logo.
This is the most important step; without it, your changes will not appear.
sudo update-initramfs -u
After the command finishes, reboot your system. You should now see your custom logo during the startup process.
Changing the Ubuntu 22.04 Login Screen (GDM) Logo
The login screen, managed by the GNOME Display Manager (GDM), is more complex. The logo is not a simple image file but is embedded within a compiled stylesheet resource. To change it, we need to extract the stylesheet, edit it, and then recompile it.
1. Install Necessary Tools
First, you need a specific utility to handle these resource files. Install it with the following command:
sudo apt update
sudo apt install libglib2.0-dev-bin
2. Create a Working Directory
To keep your files organized, create a dedicated folder for this task.
mkdir ~/gdm-customization && cd ~/gdm-customization
3. Extract the GDM Theme File
The default GDM styles are located in a binary file. Use the gresource utility to extract the stylesheet (gdm3.css) from it.
gresource extract /usr/share/gnome-shell/gdm3-theme.gresource /org/gnome/shell/theme/gdm3.css > gdm3.css
4. Modify the CSS Stylesheet
Now, open the extracted gdm3.css file with a text editor. You need to find the rule that controls the login screen background. Look for the #lockDialogGroup selector.
Inside this rule, you will find a background-image property that points to the default Ubuntu logo.
#lockDialogGroup {
background-image: url("file:///usr/share/gnome-shell/theme/ubuntu-logo.svg");
background-repeat: no-repeat;
background-position: center 60px;
background-size: 128px;
}
Change the background-image URL to point to your desired logo. For example, if you place your custom logo (e.g., my-company-logo.png) in the /usr/share/pixmaps/ directory, you would modify the line like this:
background-image: url("file:///usr/share/pixmaps/my-company-logo.png");
You can also adjust the background-size and background-position properties to fit your image perfectly.
5. Recompile the GDM Resource File
After saving your changes to gdm3.css, you must recompile it back into the .gresource format. First, create a manifest file that tells the compiler which files to include. Create a new file named gdm3-theme.gresource.xml and paste the following content into it:
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/shell/theme">
<file>gdm3.css</file>
</gresource>
</gresources>
Now, use the glib-compile-resources command to create the new resource file.
glib-compile-resources gdm3-theme.gresource.xml
This will generate a new file named gdm3-theme.gresource in your current directory.
6. Back Up and Replace the System File
Finally, back up the original GDM theme file and then replace it with your newly compiled version.
sudo cp /usr/share/gnome-shell/gdm3-theme.gresource /usr/share/gnome-shell/gdm3-theme.gresource.bak
sudo cp gdm3-theme.gresource /usr/share/gnome-shell/gdm3-theme.gresource
Reboot your computer. Your custom logo should now be displayed on the GDM login screen.
How to Revert to Default Settings
If you want to restore the original Ubuntu logos, you can easily do so by restoring the backups you created.
To Revert the Boot (Plymouth) Logo:
sudo mv /usr/share/plymouth/ubuntu-logo.png.bak /usr/share/plymouth/ubuntu-logo.png
sudo update-initramfs -u
To Revert the Login (GDM) Logo:
sudo mv /usr/share/gnome-shell/gdm3-theme.gresource.bak /usr/share/gnome-shell/gdm3-theme.gresource
After running these commands, a simple reboot will restore the original Ubuntu branding. By following these steps carefully, you can safely and effectively customize your Ubuntu 22.04 experience.
Source: https://kifarunix.com/change-ubuntu-22-04-boot-and-login-screen-logo/


