Changing the boot screen images

Hi,

Here’s a small script that allows you to replace the different bootsplash screens
that you get with openSUSE, on an openSUSE 12.2 system booting into KDE. Don’t try this
on earlier systems or ones not using KDM.

Please note that I don’t propose to change the themes that are used
but just to change the image files used for the different splash screens.

First some explanation on the bootsplash screens :

There are 4 (!) different bootspash screens you go through when booting openSUSE:

1 - The “Grub2” screen
2 - The “Plymouth” screen
3 - The “Login” screen
4 - The “KDE” splash screen

For each of these, you will need to change the image used as background.

1 - The “Grub2” screen
Thus is the very first graphical screen you get to see, where you can choose the operating system to boot.
This screen is put up by Grub2, the bootmanager.

You will have to determine the size of the image currently used. The easiest way is to
load the file /boot/grub2/themes/openSUSE/background.png into an image viewer
of your choice and check the size there.

2 - The Plymouth screen.
This is the screen you see after having chosen your OS.
The corresponding file is at:
/usr/share/plymouth/themes/openSUSE/background.png

3 - The login screen.
This is the screen where you log into the machine.
That is put up by KDM, the login manager (if you use Gnome, you probabbky
have GDM for that, but I don’t use it, so I can’t help you there.).
The file is at /usr/share/kde4/apps/kdm/themes/openSUSE/background-${KDMXSIZE}x$KDMYSIZE.jpg
There are a lot of different image files in that directory, all named
“/usr/share/kde4/apps/kdm/themes/openSUSE/background-” + some sizes+".jpg"
The “some sizes” part is just the x and y esolution of the screen.
You will have to find out which of these is used by your system, which means
finding the resolution. Normally, the KDm login screen is of the same size as your desktop, so
this is easy to find out.

4 -Finally, the KDE splashscreen
This is the image you see after you logged in and until your desktop is shown.

Here again, it’s a matter of substituting your own picture for that of the normal Suse theme.
The picture is found in :

“/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/${KDMXSIZE}x$KDMYSIZE/background.jpg”

with, again the sizes of the screen. Determine which one is used in your system, as per above.
Normally, you should be able to use the same image for the KDM login screen and this one.

Now it’s just a matter of changing the image files for the ones you want to use.
However, for the plymouth screen, you need to run mkinitrd.

Note that some if the image files are jpg, others are png! Don’t confuse them and
use the correct image format.

I’ve written a small script that does all of the hard work.

Just fill in the x and y sizes of your kdm/kde screens and also the names of your image files and and run the script.
This you have to run as root since it uses mkinitrd (which takes a LONG time to complete) and has to
muck about in directories where a normal user can’t write.

The script makes backups of the old image files that will be replaced.

There is also a way to get rid of the logos displayed during boot screens:

You can delete (or replace) the openSUSE logo that is displayed with the plymouth screen:

this lies at /usr/share/kde4/apps/kdm/themes/openSUSE/logo.svgz - if you simply delete this file,
no logo is displayed.

There is also the openSUSE logo in the KDE splash screen - the file is at
/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/${KDMXSIZE}x$KDMYSIZE/opensuse-logo.png. Don’t simply
delete this file but replace it with an empty svgz file.



#!/bin/sh

#: Title       : Bootsplash Modifier (for use with grub2 & kdm on opensuse 12.2)
#: Date Created: nov. 3, 2012
#: Last Edit   : nov. 16, 2012
#: Author      : Lenwolf
#: Version     : 1.00
#: Description : Modify boot/splash screens
#: Options     : None (Do Not Enter any Options)


#
# Set the following to your sizes
#

KDMXSIZE=1920     # xsize for kdm/kde screens
KDMYSIZE=1200      # ysize for kdm/kde screens

#
# Set the following to your image files. you will normally need two or 3 files
#

# grub2 background
IMGGRUB="/home/wolf/Documents/Bootsplash/BackgroundGrub.png"

# plymouth background displayed between grub & kdm 
IMGPLYMOUTH="/home/wolf/Documents/Bootsplash/Background${KDMXSIZE}x$KDMYSIZE.png"

# KDM login screen 
IMGKDM="/home/wolf/Documents/Bootsplash/Background${KDMXSIZE}x$KDMYSIZE.jpg"


# KDM splash screen & logo
IMGKDMLOGO="/home/wolf/Documents/Bootsplash/empty.svgz"



#
# DO NOT CHANGE ANYHTING AFTER HERE
#


#
# The directories & filename where the current files lie for openSUSE 12.2. 
# These are the files that will be modified.
#
# grub2 background
GRUB2BCKGRND="/boot/grub2/themes/openSUSE/background.png"
# plymouth background & logo: displayed between grub & kdm 
PLYMOUTH="/usr/share/plymouth/themes/openSUSE/background.png"
PLYMOUTHLOGO="/usr/share/plymouth/themes/openSUSE/logo.png"
# KDM login screen 
KDMLOGIN="/usr/share/kde4/apps/kdm/themes/openSUSE/background-${KDMXSIZE}x$KDMYSIZE.jpg"
KDMLOGINLOGO="/usr/share/kde4/apps/kdm/themes/openSUSE/logo.svgz"
# KDM splash screen & logo
KSPLASH="/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/${KDMXSIZE}x$KDMYSIZE/background.jpg"
KSPLASHLOGO="/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/${KDMXSIZE}x$KDMYSIZE/opensuse-logo.png"



# Make the GRUB2 Screen
echo "Changing the Grub2 screen background..."
echo "======================================"
echo
BACKUPFILE="${GRUB2BCKGRND}OLD"
if  -f $BACKUPFILE ];
then
  echo "  Backup file $BACKUPFILE already exists, not overwritten"
else
  cp  $GRUB2BCKGRND $BACKUPFILE
  echo "  File $GRUB2BCKGRND backed up to $BACKUPFILE"
fi
rm $GRUB2BCKGRND
cp $IMGGRUB $GRUB2BCKGRND
echo
echo ".... done."
echo "--------------------------------------"
echo ""


# Make the Plymouth screen : between grub screen & kdm login screen
echo "Making Plymouth Bootsplash screen, using mkinitrd...."
echo "====================================================="
echo
BACKUPFILE="${PLYMOUTH}OLD"
if  -f $BACKUPFILE ];
then
  echo "  Backup file $BACKUPFILE already exists, not overwritten"
else
  cp $PLYMOUTH $BACKUPFILE
  echo "  File $PLYMOUTH backed up to $BACKUPFILE"
fi
rm $PLYMOUTH
cp $IMGPLYMOUTH $PLYMOUTH

echo
echo "Now using mkinitrd. THIS TAKES TIME! PLEASE BE PATIENT"
echo
mkinitrd >nul
echo
echo ".... done."
echo "--------------------------------------"
echo ""


#KDM backdrop when selecting user in login screen
echo "Making KDM screen (=login screen)..."
echo "===================================="
echo
BACKUPFILE="${KDMLOGIN}OLD"
if  -f $BACKUPFILE ];
then
  echo "  Backup file $BACKUPFILE already exists, not overwritten"
else
  cp $KDMLOGIN $BACKUPFILE
  echo "  File $KDMLOGIN backed up to $BACKUPFILE"
fi
rm $KDMLOGIN
cp $IMGKDM $KDMLOGIN


# image after selecting user, until user's screen is shown : ksplash screen
echo "Making Ksplash screen..."
echo "========================"
echo
BACKUPFILE="${KSPLASH}OLD"
if  -f $BACKUPFILE ];
then
  echo "  Backup file $BACKUPFILE already exists, not overwritten"
else
  cp $KSPLASH $BACKUPFILE
  echo "  File $KSPLASH backed up to $BACKUPFILE"
fi
rm $KSPLASH
cp $IMGKDM $KSPLASH


echo
echo ".... done."
echo "--------------------------------------"
echo ""



echo
echo "********************* ALL DONE *********************"
echo "To see the result,reboot"


HTH
lenwolf

Nice.

I see

mkinitrd >nul

Shouldn’t that be

mkintrd >/dev/null

Now you create a file wth the name “nul”, which might embarrass the user ( if he detects that file t all).

Yep, you’re right. I just use a file called “nul” as a general throw-away file. /dev/null it should indeed be. Lenwolf

What is working correctly, but wonders me is the following combination that occurs several times:

rm $PLYMOUTH
cp $IMGPLYMOUTH $PLYMOUTH

There is no need whatsover to separately remove a file when you plan to create it anew in the next command.

This is not because it does not work as you intended or is potentialy dangerous or something. It is only that I allways am afraid that people try to learn from these published scripts and then think that this should be done this way. Thus creating misunderstandiing about what these commands do.

I never get used to the fact the cp overwrites an existing file without qualms or warning, so I always delete the file first… Lenwolf

rotfl! But take care for those cases where you forget that the target file does exist and you do the cp forgetting “the fact the cp overwrites an existing file without qualms or warning”.

After so many years of cp behaving like this (more then 40) you still are not used to it?

Hi ‘Wolf’, :smiley:

Don’t let the moderator get you down, :wink:

I was struggling to change these things for a week, it never worked. (way before the existence of your script)

Later it showed, after many ‘unexplainable’ bugs, that the ‘way’ to do it did not work, because of an unsupported version of lvm, shipped with 122.
I never used lvm before, but create all the needed partitions myself normally, and after this debacle i will never use it again.
Maybe other people may have positive experiences with it, but the fact it is not visible/supported in partitioners and rescue disks, is absolutely not what i want.

Anyway, after a reinstall, and a repartitioning (thrown away lvm), the normal way worked more or less, but i still admit, it is not ‘simple’ as in: Change bootscreen? Push Button. :-p

As i was determined to change the whole boot cycle images, i tried as long as was necessary to get it done.
And as Grub2 seems to have a cli, which seems to show when pressing: ‘e’ (edit), but because it is so ‘obvious’, i could not find it at a time i needed it, i ended up with just a limited cli, where a bootloader should have been.
With the help of some nice guys from the mailinglist, i was able to get the command to get the os booted.
I learned just what i needed to get booted at all times, provided initrd is not broken.
Since then i use grub legacy again, which uses gfx.

For those who also use grub legacy:
SDB:Gfxboot - openSUSE

I did not try your script as i am already satisfied with the openSuSE-Elegant theme during my bootcycle, but i am sure that many people will be glad you wrote this script, because all is in one place now, and sure easy to edit.

The way i would like to see it for the future, is a script like this as underlying layer of a little app in ‘systemsettings’, where the images can be simply selected from a user directory, and even converted to the format and size required, or an already prepared theme choosen, which are available on the web.
This is a ‘job’, i know. And it would have to be maintained to make any significance…
But i am sure that very many people would welcome an easy way, to change the look of the desktop the are using, to their liking.

So, thank you for this ‘first step’ towards it. :smiley:

Kind Regards,

Oddball

Nope. I still find it harebrained. Lenwolf

Hi Oddball,

Thanks for your kind words - don’t worry, I don’t think HCVV is trying to get me down :-).

I think the recommended way to change all the boot splashscreens would be to make your own theme, so don’t get your hopes up for a little app where you could just change the images…

Kind regards

lenwolf

O yes, first I am posting here as an ordinary memeber, not a mod (yes we have two hats). Second, as I said, I realy like the script. There wasa recipe earlier and I keep it somewhere to repost when somebody here asks for it, but this is up to date for new Grub2 and all that. And also in a nice, easy to understand and documented script.

My comments are not in the first place for lenwolf, but as we have an open discussion on these forums, they are for others to give them a better feeling about some of the peculiarities of bash scripting.

I recommend the script to anybody who wants to customize all those screens at boot and login.

No, i am thinking he is just ‘debugs’ your nice script… where would we be without those who ‘really’ read, and with knowledge make our efforts work for everybody?

Which means: Thanx hcvv for completing this script… :wink:

Well, to be honest, these are not my hopes…
I get things done, no matter what.
IMHO there is nothing wrong with the possibility to be able to switch these themes as easy as a desktop-background.