Display background image during .xinitrc

Window managers, icon programs, widgets, etc.
Post Reply
Message
Author
User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

Display background image during .xinitrc

#1 Post by rufwoof »

Create a png image /usr/share/images/bootlogo.png

Edit ~/.xinitrc

Near the top, just after . /etc/rc.d/PUPSTATE add

Code: Select all

export DISPLAY=':0.0'
# To set a background color
#xsetroot -solid gray &
# To show a background logo (qiv should be installed).
qiv /usr/share/images/bootlogo.png &
pid=$!
Near the bottom just before

#exec $CURRENTWM
#v2.11 GuestToo suggested this improvement...
which $CURRENTWM && exec $CURRENTWM
[ -x $CURRENTWM ] && exec $CURRENTWM
exec jwm

add

Code: Select all

# Kill the splash started earlier
echo #!/bin/bash >/tmp/killsplash
echo sleep 4 >>/tmp/killsplash
echo kill $pid >>/tmp/killsplash
echo rm /tmp/killsplash >>/tmp/killsplash
chmod a+x /tmp/killsplash
/tmp/killsplash &
You need to have installed qiv from ppm

Now, when you boot or restartX, once .xinitrc starts it will display the image and 4 seconds later as jwm/desktop is loading that image will be removed.

I created my image to by the same size as my preferred screen resolution as I use a TV as a monitor and that might help it settle into being correctly screen aligned.

User avatar
souleau
Posts: 148
Joined: Sun 23 Oct 2016, 15:24

#2 Post by souleau »

I've tried it, and it also works with feh as an image viewer. You would have to replace the qiv entry in the code with feh -x (the -x prefix for borderless window).

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#3 Post by rufwoof »

Thanks Souleau

I've been toying around with Chroma Key within OpenShot video editor and have this video clip as well started up from within .jwmrc using a tag of

Code: Select all

<StartupCommand>mpv --fs /home/user/startup.dvd</StartupCommand>
mpv's --fs parameter is 'full screen'

I used Openshots 3D animated 360 spin to create the rotating red text, added a Chroma Key to that and set the background transparent, and on a second track added the video of the image and sound. Then exported that combination to the above final clip.

That's slowed down the bootup some :(

Code: Select all

user@debian:~$ systemd-analyze
Startup finished in 10.155s (kernel) + 11.285s (userspace) = 21.440s
... but makes the waiting a little more interesting, and nicer than dog barks :)

User avatar
souleau
Posts: 148
Joined: Sun 23 Oct 2016, 15:24

#4 Post by souleau »

An intro video would be a bit over the top, and when you insist on its size being screen filling, then it would delay the booting process considerably.

What you could try, is to display an animated gif, but one that is relatively short and with indexed colors to keep the size down. I believe there's something called gifview that might be able to do the trick.

You could also use the slideshow function of feh to show a sequence of images in very rapid succession so that you would get an animation. That would go something like this:

Code: Select all

feh -x -g 1024x768+100+10 -D 0.03 --cycle-once /user/share/images/bootanimation/
Where -x stands for borderless window, -g stand for geometry which then specifies the width and height of the images, and then the offset on the x-axis and y-axis (move left/right and up/down). But I don't think that needs to be specified if your images are the same size as your screen resolution.
Then -D stands for the amount of time between the loading of succesive images (in this case 0.03, which is fast). The --cycle-once will unload the slideshow after its run itself, so there's no need to kill your splash-screen at the end of .xinitrc.
And finally the folder specification where you store your images. If the images are named in such a way that they are numbered in the right order, then that is the order it will be played in.

Post Reply