9 ms·
Show HN: High performance X11 animated wallpapers
- glouwbug 6y agoSo 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
- 0xdeadb00f 6y agoFantastic work!
- Polylactic_acid 6y agoReally it should be something built in to the DE. You need it to stop rendering when the background is covered.
- microcolonel 6y agoYou can accomplish this with straight X11, no need for the DE to be aware of it.
- pengaru 6y agoI don't think that's so trivial in a composited world. IIRC once upon a time you could easily get a viewable state from the X server for windows, but with compositing xorg made it basically always true.
- cycloptic 6y agoIn wayland it's very simple. You would use surface frame callbacks, which aren't supposed to trigger when the window is fully obscured, minimized, or off-screen on another desktop. This mechanism never seems to have made it back into composited X.
- Polylactic_acid 6y ago>In wayland it's very simple This seems to be the trend
- bkor 6y agoGNOME has backgrounds which change over the day. That's entirely different from animated though. Reading the GNOME config file, seems the background slowly transitions (fades) from one picture to another. See https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/blob/master/backgrounds/adwaita-timed.xml.in https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/blob/mast...
- deleted 6y ago[deleted]
- jcelerier 6y agofor 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
- yjftsjthsd-h 6y ago> ... or at least it would, if I was seeing my desktop background once in a while One of the very few reasons I miss stacking window managers:)
- jmcqk6 6y ago>setting mpv as background how does one do this? Just replace the Feh call with mpv?
- jcelerier 6y agompv foo.mp4 --wid=0
- glouwbug 6y agoTrue that, MPV is solid. Paperview gives me ~3% cpu usage and ~9% GPU usage on an old x230, while MPV gives me 40% cpu usage for a similar mp4. MPV works great on desktops with mp4s, while paperview is great for laptops and battery life if 15 frame gifs are being rendered (pixel art, of course!)
- IPTN 6y agoDid you create those scenes yourself? They look fantastic.
- deleted 6y ago[deleted]
- claudiawerner 6y ago>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 Is this true when you have a loop that sleeps for 5 minutes before calling it again? I've always set my wallpapers this way. It's also similar to what I do on Sway. The only alternative I've found is simple enough and still works is using an ad-hoc systemd timer task. Edit: nevermind, I forgot this is about animated wallpapers. I use a while loop + feh for setting a static wallpaper that changes every 5 minutes.
- cosmotic 6y agoI love the focus on reducing CPU, GPU, and battery consumption... but it's still going to be distracting.
- asiachick 6y agoApparently many people love distracting wallpaper https://store.steampowered.com/app/431960/Wallpaper_Engine/ https://store.steampowered.com/app/431960/Wallpaper_Engine/
- berkut 6y agoDoesn't the example video show all four cores mostly hovering at around 40-50% CPU usage (with occasional dips to 10-20%)? What else was the machine doing at the time?
- glouwbug 6y agoHeh, recording. My thinkpad is a little too slow.
- euske 6y agoYeah. 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.
- amiga-workbench 6y agoThey look good in /g/ and Reddit desktop threads.
- art4ur 6y agoIt'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.
- 6y ago
- moonchild 6y agoJust fyi, I think SDL_LoadBMP relies on sdl2_image; you may want to note that as a dependency.
- glouwbug 6y agoI 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_surface.h#L201 https://github.com/SDL-mirror/SDL/blob/master/include/SDL_su...
- h2odragon 6y agomost 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 6y agoxscreensaver 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.
- glitchc 6y agoExcellent! Some of those backgrounds look like they’re from SvC: Chaos.
- sawaruna 6y agoI think they are. It's a popular collection of 'fighting game backgrounds with nice pixel art' that get posted around pretty often.
- kanobo 6y agoLive 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 6y agoYes, 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 6y agoI miss stuff like this that doesn’t seem nearly as popular these days.
- linschn 6y agoSee the crabs from bell labs http://lucacardelli.name/Papers/Crabs.pdf http://lucacardelli.name/Papers/Crabs.pdf
- bilegeek 6y agohttps://cyber.dabamos.de/unix/x11/#xroach https://cyber.dabamos.de/unix/x11/#xroach Though it doesn't augment anything, nor does it look particularly pretty...
- umvi 6y agoI 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
- unlimit 6y agoYup, its ctrl-alt-t the moment DE loads.
- totetsu 6y agoI played around with transparent terminals over tranquil underwater videos for a bit. It was nice, but needed a bit too much resource.
- Polylactic_acid 6y agoThe only time I ever see it is on the lock screen
- mssdvd 6y agoI just use a plain black background.
- fps_doug 6y agoI set a solid purple background because I feel unused screen space is a waste.
- fho 6y agoI 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 6y agoI admit, that's pretty sweet.
- watersb 6y agoWhen 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/
- ASalazarMX 6y agoThat must have felt very tragic and awkward.
- mrweasel 6y agoXplanet 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.
- TheDesolate0 6y agoYou can do live wallpaper with xscreensaver set XSCREENSAVER_WINDOW '-root' often works just as well ex: /usr/lib/X11/xscreensaver/molecule -root will start molecule on the root window
- TheDesolate0 6y agoYou can do live wallpaper with xscreensaver To quote the man page: XSCREENSAVER_WINDOW Passed to sub-programs to indicate the ID of the window on which they should draw. This is necessary on Xinerama/RANDR systems where multiple physical monitors share a single X11 "Screen". -root often works just as well.
- sova 6y agoReally wanted this years ago when I was using Compiz/Beryl. Great job finding an efficient (in terms of power and cpu strain) implementation!
- matheusmoreira 6y agoIsn'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 6y agoPerformance 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. :)
- totetsu 6y agoI'd like to see a colour pallet cycling xll animated wallpaper http://www.effectgames.com/effect/article-Old_School_Color_Cycling_with_HTML5.html http://www.effectgames.com/effect/article-Old_School_Color_C...
- rhn_mk1 6y agoThe 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 6y agoWindows 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
- RealStickman_ 6y agoWould that work with TWMs like i3? Most animated wallpaper programs I tried didn't work correctly.
- seletz 6y agoLooking at the video, I guess the author uses I3.
- worble 6y agoIs 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 6y agoTry 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.
- wink 6y agoI 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 6y agoIf you have more than one monitor your can keep all windows fully maximized.
- INTPenis 6y agoI 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 6y agoGitLab 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 6y agoWow, thank you! The pipeline output is still a bit bad contrast but it's so much better.
- thefiregecko 6y agoThanks 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.
- ratsimihah 6y agoThis looks great! Too bad it gives me a headache.
- mercora 6y agowhen 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 :(
- rbanffy 6y agoAnimated 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.
- danmg 6y agoYou 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