
Show HN: High performance X11 animated wallpapers - glouwbug
https://github.com/glouw/paperview
======
glouwbug
So the animated wallpaper scene on linux is pretty bizarre. There are some
popular methods out there like calling `feh --fill-bg` continuously in a bash
loop but it sends your CPU usage to an astronomical 40% which drains the
laptop battery pretty quickly. I couldn't find a reasonable animated desktop
wallpaper setter, so I wrote a little utility in 150 lines or so in C that I
call from .xinitrc to randomly pick a fairly unobtrusive desktop scene when I
startx.

Quick youtube showcase:
[https://www.youtube.com/watch?v=6ZTiA885bWM](https://www.youtube.com/watch?v=6ZTiA885bWM)

~~~
jcelerier
for animated stuff I had good results with setting mpv as background. though
yours looks like it uses even less CPU, super nice :) will work wonders with
[https://1041uuu.tumblr.com](https://1041uuu.tumblr.com) stuff !

... or at least it would, if I was seeing my desktop background once in a
while

~~~
jmcqk6
>setting mpv as background

how does one do this? Just replace the Feh call with mpv?

~~~
jcelerier

        mpv foo.mp4 --wid=0

------
watersb
When my main computer was Linux laptop, I used xplanet as my desktop
background. World clock, basic weather..

This was in 2003. It would get lots of interest when I was working in public
places.

Which is why, somewhere over Greenland, a flight attendant came by and very
quietly said to me, “I noticed you work on outer space stuff. We just got word
over radio that the Space Shuttle blew up.” :-(

Very strange that the memory of that interaction would come to me about 8
hours after a more robust reentry vehicle splashed down in Florida.

[http://xplanet.sourceforge.net/](http://xplanet.sourceforge.net/)

~~~
mrweasel
Xplanet is the only animated wallpaper I've even seen used. Most people would
try it back in the early 2000 and then come to the conclusion that it wasn't
worth the CPU cycles after a few minutes.

------
umvi
I used to care about my desktop background. But as I've gotten older I find
the only time I see it is when I close every window, and sometimes I can go
for weeks without closing every window. So now I just leave it as the default
because I look at it <1% of the time anyway

~~~
fho
I mostly work in a terminal, developing in a text editor, and have my terminal
background set to 80% opaque so that I can see my background.

Every 15 minutes I pull a random image from /r/earthporn. I enjoy having a
"window" into the world :-)

Screenshot: [https://imgur.com/fkXYD07](https://imgur.com/fkXYD07)

~~~
umvi
I admit, that's pretty sweet.

------
matheusmoreira
Isn't it possible to use mpv for this?

    
    
      mpv --wid=0
    

Causes mpv to draw to the root window.

I even found a guide:

[https://github.com/digip/linux-video-
wallpaper](https://github.com/digip/linux-video-wallpaper)

Not sure what the performance is like though.

~~~
dijit
Performance is pretty good, probably even better than TFA, due to the hardware
decode of the video.

That said, in both cases transparency of things like terminals is going to be
very resource hungry.

Also, if you're doing the --wid=0, throw in --loop there too. :)

------
wink
I have 3 screens. Amount of pixels that show my desktop: 0

I am honestly confused why, years ago, I spent hours searching for the perfect
wallpaper on the internet. And why I spent even more hours making my own, 20
years ago.

Nowadays I usually set one I like when I install the machine and maybe change
it 1-4 years later. Is this what growing up feels like? :(

~~~
imtringued
If you have more than one monitor your can keep all windows fully maximized.

------
h2odragon
most of xscreensaver's hacks will use the root window if you ask them too.

I'm using GLava [1] to put an audio spectrograph up on one side of my desktop,
i run it with windowed games and transparency and so on and its never more
than a 5% of CPU that I've ever seen.

[1] [https://github.com/jarcode-foss/glava](https://github.com/jarcode-
foss/glava)

no link for xscreensaver, jwz doesn't like hacker news

~~~
platz
xscreensaver is nice when you eliminate all the "busy" modes and then turn
down all the sliders on each mode you have left so that it moves very slowly.

the only thing i haven't figured out is how to get the fonts working again.

------
cosmotic
I love the focus on reducing CPU, GPU, and battery consumption... but it's
still going to be distracting.

~~~
euske
Yeah. I don't mean to be disrespectful to the OP, but what's the point of
having wallpapers, anyway? Distraction is one thing, but it's also obstructed
when you open a large window. I can kind of understand having a screensaver
with a beautiful picture, but today screensavers are things of the past.

~~~
art4ur
It's the same reason I change my icons and desktop theme. I'm gonna stare at
this screen for 10+ hours a day, I want it to be beautiful.

~~~
cosmotic
At the cost of usable? IDK about that tradeoff. With the wallpaper
specifically, it's always covered, at least on all the computers I use.

------
kanobo
Live wallpapers would be much more compelling if the background had context-
awareness of what was in the foreground and could interact and animate in a
way that augmented the foreground apps instead of just being pretty. Maybe
with smart people, future OSes will make that possible.

~~~
julianlam
Yes, maybe with a little sheep that walked around your windows and teetered
over the edges...

[https://adrianotiger.github.io/desktopPet/](https://adrianotiger.github.io/desktopPet/)

~~~
lathiat
I miss stuff like this that doesn’t seem nearly as popular these days.

------
INTPenis
I never saw the point of this, or Active Desktop back in the day.

But the last three releases of Fedora and Gnome have had a sort of animated
wallpaper. It's actually just an XML file that defines times and image files
for each time. And it's used to darken the wallpaper when the sun sets.

I use the default one that ships with Fedora but the XML file is
straightforward and it's simple to make your own.

One thing that will make me use more advanced desktop features is definitely
alleviating eye strain.

In that vein, using a CLI tool to check up on Gitlab pipelines is another
recent development. Switching back and forth between a dark solarized terminal
and a bright Gitlab Firefox window was becoming annoying.

(I know there are lots of CSS tricks you can do in FF to force dark styles on
websites but I try to keep my setup as vanilla as possible to ease its
management.)

~~~
zamadatix
GitLab has a real dark mode in the preferences now. You need to refresh once
you select it. The dark syntax highlighting preference plays well with it.

Not that there is anything wrong with a CLI workflow.

~~~
INTPenis
Wow, thank you! The pipeline output is still a bit bad contrast but it's so
much better.

------
danmg
You can use the binaries from xscreensaver as moving backgrounds. If you
execute them directly they'll write to the root window.

Example:

    
    
       $ /usr/lib/xscreensaver/moire2 -root

------
thefiregecko
Thanks for sharing this, I've been looking for options for an active wall
paper that doesn't passivly wreck my performance. I look forward to giving
this a try.

------
worble
Is there a decent repository for these kind of short animated backgrounds?
Ideally pixel graphics like the one in the preview video. I'd like to
experiment with this, but a quick duckduckgo search didn't turn up much; some
sites were advertising images as animated but they were in fact still images,
and most of the others had gifs of varying quality, and weren't even
consistently 1080p.

~~~
neurostimulant
Try stock hd video sites like videezy.com. You'll have to convert the hd
videos into suitable format yourself though, but that should be easy enough.

------
sova
Really wanted this years ago when I was using Compiz/Beryl. Great job finding
an efficient (in terms of power and cpu strain) implementation!

------
totetsu
I'd like to see a colour pallet cycling xll animated wallpaper
[http://www.effectgames.com/effect/article-
Old_School_Color_C...](http://www.effectgames.com/effect/article-
Old_School_Color_Cycling_with_HTML5.html)

------
RealStickman_
Would that work with TWMs like i3? Most animated wallpaper programs I tried
didn't work correctly.

~~~
seletz
Looking at the video, I guess the author uses I3.

------
moonchild
Just fyi, I think SDL_LoadBMP relies on sdl2_image; you may want to note that
as a dependency.

~~~
glouwbug
I believe BMP loading is included into the core SDL2 library, but not other
formats, which SDL_image remedies. Here is SDL_Surface.h. SDL_LoadBMP is just
a macro using SDL_RWFromFile.

[https://github.com/SDL-
mirror/SDL/blob/master/include/SDL_su...](https://github.com/SDL-
mirror/SDL/blob/master/include/SDL_surface.h#L201)

------
glitchc
Excellent! Some of those backgrounds look like they’re from SvC: Chaos.

~~~
sawaruna
I think they are. It's a popular collection of 'fighting game backgrounds with
nice pixel art' that get posted around pretty often.

------
rbanffy
Animated backgrounds not so much, but I really miss screensavers.

Of course they make no sense these days. Still, I liked the interesting
displays while my workstation was left to its own thoughts.

------
rhn_mk1
The style of the wallpapers and animations reminds me of the Windows 95 Plus
theme pack. There was something that animated once every few minutes, but I
can't recall what exactly…

~~~
dijit
Windows Vista had animated backgrounds in the ultimate edition. Was very heavy
on CPU though[0].

There used to be a way of displaying websites on the desktop in windows 2000.
“Live desktop” I think it was called[1].

[0]:
[https://en.wikipedia.org/wiki/Windows_DreamScene](https://en.wikipedia.org/wiki/Windows_DreamScene)

[1]:
[https://en.wikipedia.org/wiki/Active_Desktop?wprov=sfti1](https://en.wikipedia.org/wiki/Active_Desktop?wprov=sfti1)

------
mercora
when i see some geometric animations often in small badly encoded videos i
wish i would know a repository of programs that create these in order to
render them onto the background in a pixel perfect manner without wasting too
much resources. but i was not able to find some yet :(

------
ratsimihah
This looks great! Too bad it gives me a headache.

