LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   An animated KDE background (https://www.linuxquestions.org/questions/linux-general-1/an-animated-kde-background-385978/)

Corporal 11-23-2005 08:09 PM

An animated KDE background
 
Is it possible to create an animated background in KDE, from perhaps a screensaver or something else? I know that it is possible to run the old X screensavers on the root window, but kdesktop covers that up, making it very impractical to use. So, I'm wondering, is there any way to make the actual KDE desktop animated (and look pretty at the same time)?

Brian1 11-23-2005 08:43 PM

I have seen something like this before. I cannot for the life of me find it. If I remember correctly it talked about using mplayer to put the video on the background layer. I tried it but never could get it to work. The default background needs to be a blank screen and I guess it means a solid color. From your post it sounds about the same. I would like to be able to do it myself. If you figure it out or find the post I am talking about please post a link here to it. The article steps says kde as the gui. I think the video played because I heard sound but never seen video. It seemed to be behind the background which was a plain color at the time. Just could not figure out how to get rid of the background. There might be so documention in mplayer about the available switches it uses.

I would be curious to know how the old Xscreensaver can run on the root window. Is there a website with info on it and if so where?

Hope this helps.
Brian

Corporal 11-23-2005 09:14 PM

Well, to run a Xscreensaver in the root window, all you have to do is start the xscreensaver daemon (if you don't have it running already), go to /usr/lib/xscreensaver/ , and run <name of screensaver> with the "-root" switch. Doing that puts it in the root window. However, as mentioned above, Kdesktop covers up the root window, so if you've got that running, trying to do this will be pointless. I don't think there is a single website for info on it; I got the idea from reading up on some really old (as in before Kdesktop was even implemented) KDE FAQ. Here's the URL: http://sunsite.bilkent.edu.tr/pub/li.../kdefaq-6.html

Some bad news, though: According to a KDE developer, 'linking' a screensaver to the desktop is not coded into KDE yet, nor "will we see such a feature for a long time." But, fortunately, KDE is open-source, so it wouldn't be hard to write a program to do this. I'm not much of a Linux programmer myself, yet, but if someone does take this more-or-less daunting task upon themself, please do let us know!

And, hey, didn't the Linux kernel start off simply because the developers weren't listening...?

auditek747 11-24-2005 04:56 PM

You can have a vid as your root desktop, all you need is Mplayer.
(Sort of)

A command could be:

mplayer -zoom -fs -nosound /home/foo/video.avi -rootwin

You could replace the video with a TV capture or
an internet stream.

This is a generic setup for plain X.
Of course we all run window managers and desktop environments
and what not and they tend to get in the way of the root window.

So far I have only gotten this working with KDE, and it's
not yet perfect.

For KDE:

Right click on the desktop and select "Configure Desktop".
On the left, select "Behavior".
Make sure you check "Allow programs in desktop window", then
uncheck "Show icons on desktop".

http://pg.photos.yahoo.com/ph/johnve...e2.jpg&.src=ph

You will not have Icons on your desktop with this setup, so
put everything you want in the kicker.

Now on the left, select "Background".
For your background select "No picture".

http://pg.photos.yahoo.com/ph/johnve...e2.jpg&.src=ph

On the right (under the picture of a monitor) select
"Advanced Options"

From here, check "Use the following program for drawing the
background".

http://pg.photos.yahoo.com/ph/johnve...e2.jpg&.src=ph

On the right, select "Add".
Here you can give the thing a name, a command, the executable,
and set the refresh time.

http://pg.photos.yahoo.com/ph/johnve...e2.jpg&.src=ph

select a couple "OK"'s, an "Apply", restart X and you're golden.

I mentioned before that this is not perfect. The problem
is the "Refresh time".
It can be set from 5min to 60min, in 5min increments.
Whenever the desktop refreshes though, Mplayer gets all
mucked up. It seems to be restarting the stream without
stopping the previous.
I don't think you can tell Mplayer to play for an amount
of time. (00:59:59 for example)
I also don't know if it can be set to allow only one instance.
Perhaps I need to write a script using some scheduler or
another to time Mplayer, then put it as the "command" in
the "Configure Background Program" dialog.

Of course I'm just some "shmooze" and not real handy at writing scripts,
so if anyone has a better idea, feel free to give your two cents!

Here's a screenie of it in action:

http://pg.photos.yahoo.com/ph/johnve...e2.jpg&.src=ph

You will recognize the movie as the great hero epic -

"Santa Clause Conquers the Martians" !

Perhaps some of this info will help you get a screensaver going
as the root window. Fireworks would be nice!

EDIT...EDIT...EDIT...

I have this working well on my machine!!!
See below !!!

auditek747 11-25-2005 01:53 AM

Well, time to show my true Shmooze colors!

I wrote a simple script to stop mplayer two seconds before
the desktop background program refreshed.
(with refresh set to 5min)

Code:

#!bin/sh
mplayer -zoom -fs tv://46 -tv driver=bsdbt848:noaudio:input=1:norm=ntsc:chanlist=us-cable:width=320:height=240 -rootwin &
sleep 298
killall mplayer

Mplayer would stop after 298 seconds, but sometimes it would start up
two seconds later and sometimes it would'nt.
Sometimes it would restart and cpu usage would jump to 100% and
stay there.

It turns out I was making things harder than they needed to be.
The whole part about going to the "Advanced" section and using a
program to draw the background is not necessary.

This is the revised setup I'm using to get Mplayer in the root window
of my KDE box.

Right click on the desktop and select "Configure Desktop".
On the left, select "Behavior".
Make sure you check "Allow programs in desktop window", then
uncheck "Show icons on desktop".

http://pg.photos.yahoo.com/ph/johnve...e2.jpg&.src=ph

You will not have Icons on your desktop with this setup, so
put everything you want in the kicker.

Now on the left, select "Background".
For your background select "No picture".
In the "Options" dialog, for "Colors", select "Single Color".

http://pg.photos.yahoo.com/ph/johnve...e2.jpg&.src=ph

That should be all there is to it.
You can now start mplayer with the options you wish, with
-rootwin at the end.
Here's mine for TV channel 46:

Code:

mplayer -zoom -fs tv://46 -tv driver=bsdbt848:noaudio:input=1:norm=ntsc:chanlist=us-cable:width=320:height=240 -rootwin
You could also play a vid using the "-loop" option.

Code:

mplayer -zoom -fs -nosound -loop 0 /home/foo/vid.avi -rootwin
I think would be right.


You can't separate it from your term by using "&", so to keep from having
an unusable term open all the time I'm using the KDE "Run" dialog from the Kmenu.

I know this doesn't get you a screensaver on the desktop, but
maybe the info will be of use.

It taught me that TV or a movie on as the desktop is boring
without sound and anoying with sound.

I need to find a long video or a live stream of snow falling in the
country, a fishtank, or girls on the beach. You know, something soothing.

Corporal 11-27-2005 01:36 AM

Thanks for the info! I suppose if, somehow, the screensaver was running constantly and was being streamed from another computer (or loopbacked somehow...), then I this would work perfectly! Although writing a hack for Kdesktop that just redirects graphics from the root window would be simpler, I'm not skilled enough to do it. But still, thanks for the help!

Brian1 11-28-2005 06:06 PM

Great reading, when I have time I will give it a try.

Brian1

Blackhawkckc 01-15-2008 01:10 AM

Its been a LONG time since this was posted, but hey.. why not
 
You can run a video background, complete with icons on your screen.

This is easily possible if you have xwinwrap and mplayer installed. Try running "xwinwrap -ni -o 0.3 -fs -s -st -sp -b -nf -- mplayer -wid WID -quiet -vo gl2 -ao alsa '/path/to/mpeg.mpg' -loop 0"

Set your background so its black (or white) before you run that. It looks a lot better, otherwise the mpeg runs on top of your default background image.

dive 01-15-2008 01:39 PM

If you xscreensaver installed you can get a screensaver background by e.g.

'/usr/libexec/xscreensaver/glmatrix -root'


All times are GMT -5. The time now is 10:52 PM.