1

Is there any way (maybe with ImageMagik or something) to load a full screen image from a shell script and then close it?

I have a media PC that loads kodi, mythTV and a few other things. I was hoping that rather than show the desktop etc, I could hold off loading kodi until everything is ready, and just show a full screen image rather than the desktop. So the shell script (that would be in the startup items) would look something like:

#!/bin/bash
#first load the image full screen
display -options here ~/Pictures/loader.jpg

#do other stuff here and sleep if required
loadstuff
sleep 10

#close the image
display -close orwhatever

#load kodi
kodi &

I currently have everything working, the only issue is it sits on the desktop for 5sec (while another application, AndroMouse runs) and then loads kodi, which then waits for mythTV to start before loading the PVR plugin.

I want to not show the desktop (if I don't load AndroMouse you never see the desktop, goes straight to Kodi), instead I want to show a full screen loading image, and I will just get Kodi to wait loading until myth is done.

How can I load the image full screen before anything else (before as much as possible) and then take the image down again when I get to that part of the script?

1 Answer 1

1

OK, for now I have something that works, if someone comes up with a better solution (and explains why it is a better solution) I will accept that answer.

So I use eog (Eye of gnome), and to launch it use this command:

eog -f -w -g ~/Pictures/loader.png 1>/dev/null 2>&1&

So this loads the the image loader.png from the Pictures directory in the home directory into eye of gnome. It uses the options of -f (full screen), -w (single window mode) and -g (not a gallery) as it loads. Single window mode then allows you to launch it as many times as you want (to bring it back to the foreground) without opening it for a second time.

Then there is the "1>/dev/null 2>&1&" after it. This basically puts all errors to the one output and pipes that output to NULL so that no errors are fed back to the script making the call (as this causes issues with that script). The & at the end just makes it run its own thread so your not waiting for it to close before going on to the next part.

When you want to get rid of the image, you can just use the call:

pkill eog

NOTE: This will kill any instances of eog, so make sure you are not using eog anywhere else at the time (or any scripts etc that have eog in the name).

So to put this together in a sample .sh file, you could do:

#!/bin/bash
#set the image to use for the loader
loadImage=~/Pictures/loader.png

#load the loader image
eog -f -w -g $loadImage 1>/dev/null 2>&1&

#load any other apps required
~/scripts/andromouse/andromouse.sh 1>/dev/null 2>&1&
~/scripts/startMyth.sh 1>/dev/null 2>&1&

eog -f -w -g $loadImage 1>/dev/null 2>&1&

#launch kodi over the image and then get rid of the image
~/scripts/startKodi.sh
sleep 5
pkill eog

exit

This will put the image up, start whatever background programs etc you need, launch Kodi, wait 5 seconds and then close the image. The reason for waiting the 5 seconds is to make sure Kodi is on the screen before getting rid of the image. Kodi loads over the top anyhow (as long as you don't make the call to eog after the launch Kodi command).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .