1819794 Members
3385 Online
109607 Solutions
New Discussion юеВ

Creating a splash screen

 
SOLVED
Go to solution
John Meissner
Esteemed Contributor

Creating a splash screen

I have several scripts that I'd like to add a splash screen to. I've done all my scripting in ksh. is there a way for me to display graphics at the scripts startup? and if so can I differentiate between a terminal and an X display to do this?

I know this is a "nice to have" thing. I just don't know if it's possible.
All paths lead to destiny
14 REPLIES 14
Shannon Petry
Honored Contributor

Re: Creating a splash screen

It is possible, but not easy. I think the easiest thing to do, is test for DISPLAY, if it's set you could display a graphic. If it's not, then dont.

You would want to at least call the graphics with a minimum of perl, because it would be much easier. In a shell, the loop/script will stop executing when you xwud a graphic. In perl/C/C++ you can continue the code, then go back and drop that function. Much easier to do.

If you use perl, and your shells are all vt220 or better you can use curses to do nice borders, colors, highlighting, etc...

Fancy is much better in Perl or C.

Any shell is going to be rough and rugged, but work very well.

Regards,
Shannon
Microsoft. When do you want a virus today?
John Meissner
Esteemed Contributor

Re: Creating a splash screen

I'm actually looking into perl but I have very very little experience using perl. I don't know how to display a graphic using perl but I'm trying to find out.

I'm not finding much on google about this subject either.
All paths lead to destiny
Steve Steel
Honored Contributor

Re: Creating a splash screen

Hi


Look at


dtksh(user cmd) dtksh(user cmd)

NAME
dtksh - shell command language interpreter with access to many X, Xt,
Xm and CDE functions



Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Shannon Petry
Honored Contributor

Re: Creating a splash screen

There are literally libraries of Perl cookbooks and guides. Perl Black book 2nd editition is very good, Learining Perl (O'Reilly and Associates) is a good starting point. basically, you run a
system("/usr/bin/X11/xwid spash.xwd");
if it's an X dump. You would need a separate app no matter what the graphic is, as nothing displays auto-magically.


Regards,
Shannon
Microsoft. When do you want a virus today?
John Meissner
Esteemed Contributor

Re: Creating a splash screen

That's a step in the direction I want to go...

but I would eventually like to take a picture of a logo... and have it display when launching the script. (I'm not looking to do ascii word art with colors as a splash).

I think this might be much more trouble than it's worth. I do appreciate the help though. thanks for the effort.
All paths lead to destiny
Robert Gamble
Respected Contributor

Re: Creating a splash screen

I have written a few dtksh scripts. They are very good for displaying menus. It is possible to display as splash pop-up, but I cannot think of a way to display your image file without using/bundling an image viewer as well.

Good Luck!
Wodisch
Honored Contributor

Re: Creating a splash screen

Hi,

if you want a pretty simple, but just a little crude version to do this, look at "xwd" and "xwud". The first to save an existing window/picture to a file, the second to display it again...

once:
$ xwd -out /tmp/picture.xwd

often:
$ xuwd -in /tmp/picture.xwd -geometry +400+200 &
$ pid="$!"
$ sleep 10 # or do something
$ kill $pid

FWIW,
Wodisch

John Meissner
Esteemed Contributor

Re: Creating a splash screen

Wodisch - You're the closest so far. Everything you told me works... except the picture didn't display ... I'm not sure why. I'll play around with this some more and see If I can get it working. and I didn't have xuwd... it's xwud on my system... I'm guessing this is a type-o
All paths lead to destiny
John Poff
Honored Contributor

Re: Creating a splash screen

Hi John,

Are you putting in a splash screen in front of your disaster recovery scripts to scare off any unauthorized users who might want try to run them? How about a nice skull and crossbones logo! :)

JP

Shannon Petry
Honored Contributor
Solution

Re: Creating a splash screen

xwud is in /usr/bin/X11, or at least should be. It's a base utility for X, and actually means "X Window Un-Display".

The reason it may not work, is because your image format is not in X-windows dump format. To create this, use "xwd" or "X Window Dump", again in /usr/bin/X11.

I.E.

/usr/bin/X11/xwd -out /someplace/mysplash.xwd -nobdrs -db

You can read the man pages for other options, especially if you dont want borders.

You need to have the image available in X on display in a single window to create it.

You can also use HP screen capture if you have it installed. This installs with the wt toolkit, along with white board, shared X, etc.... Gimp can also save your image as xwd format.

Regards,
Shannon
Microsoft. When do you want a virus today?
John Meissner
Esteemed Contributor

Re: Creating a splash screen

Hey John.... I was actually thinking either a company logo... (ok... end obligatory company BS) or more likely I wanted to do a pic of a phoenix... appropriate if you think of a phoenix raising from the ashes and a server being recovered from a disaster.


by the way... the candy IS being worked on.... filling up a box to send to you for your help :)
All paths lead to destiny
Shannon Petry
Honored Contributor

Re: Creating a splash screen

Sorry, doing too many things at once today ;) xwud means "X Windows Un-DUMP", not un-display.

Shannon
Microsoft. When do you want a virus today?
John Meissner
Esteemed Contributor

Re: Creating a splash screen

I tried using xwd... but for some reason it didn't work... i used Gimp from my linux box. I had to flatten the image first (probably my problem) and then I saved it as xwd format. Then displaying the image worked. Thank you all for your help :)
All paths lead to destiny
John Meissner
Esteemed Contributor

Re: Creating a splash screen

Wodisch - If you repost I'll give you some more points since the problem was my picture's problem and not yours.
All paths lead to destiny