xscreensaver under Wayland

TechnoJunky

Well-Known Member
Joined
Dec 3, 2018
Messages
505
Reaction score
405
Credits
432
Given up on having a screensaver under Wayland? You don't have to. I accidently stubled upon a solution, or work around. You need to have xscreensaver installed and you need to create 2 files. Unfortunately you can't use the GUI configuration tool, you'll either need to use a VM for that or edit the text file manually.

The first file you need to create is an autostart file, located ~/.config/autostart, call it xscreensaver.desktop. In it, place the following text
Code:
[Desktop Entry]
Comment[en_US]=
Comment=
Exec=xscreensaver -nosplash
GenericName[en_US]=
GenericName=
Icon=system-run
MimeType=
Name[en_US]=XscreenSaverStartup
Name=XscreenSaverStartup
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Next, either copy this file from a VM or create it. ~/.xscreensaver and place the below text in it.
Code:
# XScreenSaver Preferences File
# Written by xscreensaver-demo 5.45 on Sun Jan  8 12:28:22 2023.
# https://www.jwz.org/xscreensaver/

timeout:    0:15:00
cycle:        0:03:00
lock:        False
lockTimeout:    0:03:00
passwdTimeout:    0:00:30
visualID:    default
installColormap:    True
verbose:    False
timestamp:    True
splash:        True
splashDuration:    0:00:05
demoCommand:    xscreensaver-demo
prefsCommand:    xscreensaver-demo -prefs
nice:        10
memoryLimit:    0
fade:        False
unfade:        False
fadeSeconds:    0:00:03
fadeTicks:    20
captureStderr:    True
ignoreUninstalledPrograms:False
font:        *-medium-r-*-140-*-m-*
dpmsEnabled:    False
dpmsQuickOff:    False
dpmsStandby:    0:30:00
dpmsSuspend:    0:30:00
dpmsOff:    0:30:00
grabDesktopImages:  False
grabVideoFrames:    False
chooseRandomImages: False
imageDirectory:    

mode:        one
selected:    176

textMode:    url
textLiteral:    XScreenSaver
textFile:    
textProgram:    fortune
textURL:    http://fridge.ubuntu.com/node/feed

programs:                                      \
                maze -root                    \n\
  GL:                 superquadrics -root                \n\
                attraction -root                \n\
-                blitspin -root                    \n\
                greynetic -root                    \n\
                helix -root                    \n\
                hopalong -root                    \n\
                imsmap -root                    \n\
                noseguy -root                    \n\
-                pyro -root                    \n\
                qix -root                    \n\
-                rocks -root                    \n\
                rorschach -root                    \n\
-                decayscreen -root                \n\
-                flame -root                    \n\
                halo -root                    \n\
-                slidescreen -root                \n\
-                pedal -root                    \n\
                bouboule -root                    \n\
                braid -root                    \n\
-                coral -root                    \n\
-                deco -root                    \n\
-                drift -root                    \n\
-                fadeplot -root                    \n\
                galaxy -root                    \n\
                goop -root                    \n\
                grav -root                    \n\
                ifs -root                    \n\
-                unicode -root                    \n\
- GL:                 jigsaw -root                    \n\
                julia -root                    \n\
-                kaleidescope -root                \n\
  GL:                 moebius -root                    \n\
                moire -root                    \n\
  GL:                 morph3d -root                    \n\
                mountain -root                    \n\
                munch -root                    \n\
                penrose -root                    \n\
  GL:                 pipes -root                    \n\
                rd-bomb -root                    \n\
  GL:                 rubik -root                    \n\
-                sierpinski -root                \n\
-                slip -root                    \n\
  GL:                 sproingies -root                \n\
-                starfish -root                    \n\
                strange -root                    \n\
                swirl -root                    \n\
                triangle -root                    \n\
                xjack -root                    \n\
                xlyap -root                    \n\
  GL:                 atlantis -root                    \n\
                bsod -root                    \n\
  GL:                 bubble3d -root                    \n\
  GL:                 cage -root                    \n\
-                crystal -root                    \n\
                cynosure -root                    \n\
                discrete -root                    \n\
-                distort -root -reflect                \n\
                epicycle -root                    \n\
                flow -root                    \n\
  GL:                 glplanet -root                    \n\
                interference -root                \n\
                kumppa -root                    \n\
  GL:                 lament -root                    \n\
                moire2 -root                    \n\
  GL:                 sonar -root                    \n\
  GL:                 stairs -root                    \n\
                truchet -root                    \n\
-                vidwhacker -root                \n\
                blaster -root                    \n\
                bumps -root                    \n\
-                ccurve -root                    \n\
                compass -root                    \n\
                deluxe -root                    \n\
                demon -root                    \n\
  GL:                 extrusion -root                    \n\
-                loop -root                    \n\
                penetrate -root                    \n\
                petri -root                    \n\
-                phosphor -root                    \n\
  GL:                 pulsar -root                    \n\
                ripples -root                    \n\
                shadebobs -root                    \n\
  GL:                 sierpinski3d -root                \n\
-                spotlight -root                    \n\
                squiral -root                    \n\
                wander -root                    \n\
-                webcollage -root                \n\
-                xflame -root                    \n\
                xmatrix -root                    \n\
- GL:                 gflux -root                    \n\
-                nerverot -root                    \n\
                xrayswarm -root                    \n\
                xspirograph -root                \n\
  GL:                 circuit -root                    \n\
  GL:                 dangerball -root                \n\
  GL:                 engine -root                    \n\
- GL:                 flipscreen3d -root                \n\
  GL:                 gltext -root                    \n\
  GL:                 menger -root                    \n\
  GL:                 molecule -root                    \n\
-                rotzoomer -root                    \n\
                speedmine -root                    \n\
- GL:                 starwars -root                    \n\
  GL:                 stonerview -root                \n\
                vermiculate -root                \n\
                whirlwindwarp -root                \n\
-                zoom -root                    \n\
                anemone -root                    \n\
-                apollonian -root                \n\
  GL:                 boxed -root                    \n\
  GL:                 cubenetic -root                    \n\
  GL:                 endgame -root                    \n\
-                euler2d -root                    \n\
                fluidballs -root                \n\
  GL:                 flurry -root                    \n\
- GL:                 glblur -root                    \n\
  GL:                 glsnake -root                    \n\
                halftone -root                    \n\
  GL:                 juggler3d -root                    \n\
  GL:                 lavalite -root                    \n\
-                polyominoes -root                \n\
  GL:                 queens -root                    \n\
  GL:                 sballs -root                    \n\
  GL:                 spheremonics -root                \n\
-                thornbird -root                    \n\
                twang -root                    \n\
- GL:                 antspotlight -root                \n\
                apple2 -root                    \n\
  GL:                 atunnel -root                    \n\
-                barcode -root                    \n\
  GL:                 blinkbox -root                    \n\
  GL:                 blocktube -root                    \n\
  GL:                 bouncingcow -root                \n\
-                cloudlife -root                    \n\
  GL:                 cubestorm -root                    \n\
                eruption -root                    \n\
  GL:                 flipflop -root                    \n\
  GL:                 flyingtoasters -root                \n\
-                fontglide -root                    \n\
  GL:                 gleidescope -root                \n\
  GL:                 glknots -root                    \n\
  GL:                 glmatrix -root                    \n\
- GL:                 glslideshow -root                \n\
  GL:                 hypertorus -root                \n\
  GL:                 jigglypuff -root                \n\
                metaballs -root                    \n\
  GL:                 mirrorblob -root                \n\
                piecewise -root                    \n\
  GL:                 polytopes -root                    \n\
                pong -root                    \n\
                popsquares -root                \n\
  GL:                 surfaces -root                    \n\
                xanalogtv -root                    \n\
                abstractile -root                \n\
-                anemotaxis -root                \n\
  GL:                 antinspect -root                \n\
                fireworkx -root                    \n\
-                fuzzyflakes -root                \n\
                interaggregate -root                \n\
                intermomentary -root                \n\
-                memscroller -root                \n\
  GL:                 noof -root                    \n\
                pacman -root                    \n\
  GL:                 pinion -root                    \n\
  GL:                 polyhedra -root                    \n\
- GL:                 providence -root                \n\
                substrate -root                    \n\
                wormhole -root                    \n\
  GL:                 antmaze -root                    \n\
- GL:                 boing -root                    \n\
                boxfit -root                    \n\
- GL:                 carousel -root                    \n\
                celtic -root                    \n\
  GL:                 crackberg -root                    \n\
  GL:                 cube21 -root                    \n\
                fiberlamp -root                    \n\
- GL:                 fliptext -root                    \n\
  GL:                 glhanoi -root                    \n\
  GL:                 tangram -root                    \n\
  GL:                 timetunnel -root -no-logo            \n\
  GL:                 glschool -root                    \n\
  GL:                 topblock -root                    \n\
  GL:                 cubicgrid -root                    \n\
                cwaves -root                    \n\
  GL:                 gears -root                    \n\
  GL:                 glcells -root                    \n\
  GL:                 lockward -root                    \n\
                m6502 -root                    \n\
  GL:                 moebiusgears -root                \n\
- GL:                 voronoi -root                    \n\
  GL:                 hypnowheel -root                \n\
  GL:                 klein -root                    \n\
-                lcdscrub -root                    \n\
- GL:                 photopile -root                    \n\
- GL:                 skytentacles -root                \n\
  GL:                 rubikblocks -root                \n\
  GL:                 companioncube -root                \n\
  GL:                 hilbert -root                    \n\
  GL:                 tronbit -root                    \n\
  GL:                 geodesic -root                    \n\
                hexadrop -root                    \n\
  GL:                 kaleidocycle -root                \n\
- GL:                 quasicrystal -root                \n\
  GL:                 unknownpleasures -root                \n\
                binaryring -root                \n\
  GL:                 cityflow -root                    \n\
  GL:                 geodesicgears -root                \n\
  GL:                 projectiveplane -root                \n\
  GL:                 romanboy -root                    \n\
-                tessellimage -root                \n\
  GL:                 winduprobot -root                \n\
- GL:                 splitflap -root                    \n\
-                testx11 -root                    \n\
  GL:                 electricsheep -root 1                \n\
- GL:                 cubestack -root                    \n\
- GL:                 cubetwist -root                    \n\
- GL:                 discoball -root                    \n\
- GL:                 dymaxionmap -root                \n\
- GL:                 energystream -root                \n\
- GL:                 hexstrut -root                    \n\
- GL:                 hydrostat -root                    \n\
- GL:                 raverhoop -root                    \n\
- GL:                 splodesic -root                    \n\
- GL:                 unicrud -root                    \n\
- GL:                 esper -root                    \n\
- GL:                 vigilance -root                    \n\
- GL:                 crumbler -root                    \n\
                filmleader -root                \n\
                glitchpeg -root                    \n\
- GL:                 handsy -root                    \n\
- GL:                 maze3d -root                    \n\
- GL:                 peepers -root                    \n\
- GL:                 razzledazzle -root                \n\
                vfeedback -root                    \n\
                scooter -root                    \n\
- GL:                 deepstars -root                    \n\
- GL:                 gravitywell -root                \n\
- GL:                 beats -root                    \n\
- GL:                 covid19 -root                    \n\
- GL:                 etruscanvenus -root                \n\
- GL:                 gibson -root                    \n\
- GL:                 headroom -root                    \n\
- GL:                 sphereeversion -root                \n\


pointerPollTime:    0:00:05
pointerHysteresis:  10
windowCreationTimeout:0:00:30
initialDelay:    0:00:00
GetViewPortIsFullOfLies:False
procInterrupts:    True
xinputExtensionDev: False
overlayStderr:    True
authWarningSlack:   20

Looking at this file in Kate or any text editor with line numbers, you 'll see that on line 38 it shows 'selected: 176'. This is the secreensaver I am using. If look futher down at line 46, you'll see 'programs'. This is basically a header for all the screensavers. The screen saver on line 47 is the first one. If you take 47 and add 176 (my screensaver, you get 223. If you look at line 223 you'll see 'fiberlamp', this is my screensaver.

This isn't a perfect solution. I have my timeout set for 15 minutes and what I've found is even though I'm using the computer, the screensaver runs every 15 minutes and have to move the mouse to clear it, yes even though I'm actively using the mouse and keyboard.
 


It's crazy y'all are talking about this, and that iomari brought that up, because while minor in the grand scheme of thing has been a holding point.
Let me start from the beginning.

This has been my wish for a long time. Funnily enough I remember when Wayland started. Oh boy the backlash then. I knew nothing about Linux. I just needed sometime to get a handme down online. I was just a stupid college kid forcing Linux to work on an outdated Dell Inspiron Desktop. It took an actual literal week, but I perservered and I've never looked back. Goal still is to be a Linux Admin of some sorts, but okay story time done. The cursory thing is I fell in love with the screensavers X Window System provided. Heck, I have all my boxes forced to ghetto run X Screensavers in one way or another and I love them.

Today, on my wifes birthday, she glanced by in my office and said "That's gorgeous". While I was standing there and she told me quickly I was gorgeous as well, she meant the screensaver. She had seen many, many, many of the different screensavers (and proceeded to talk about how she loved them), and I agree. As an artist and graphic designer...I would hate...no I would loath losing such beautiful works of art. Am I the only one to let my boxes and laptops go to screensaver (and lock) so I have an office full of beautiful fractals, bits of running performance data portrayed in wavy font, or watching the ball bouncing get oh so close to the corner!? Like, I have multiple machines running, and I don't want them idling at the stupid login screen. So boring and just ugly. Does nobody use screensavers, or you just shut it off??? I don't know, but I will not let these beautiful works of art die.

Thank you TechnoJunky. This is a piece to the puzzle.

I have no idea what language or where I should start. But I want to make all of the X Window System Screensavers available to Wayland and beyond. As in you can keep making new ones. What made X Screensavers amazing was the community. And YES I have already been to the original (or at least last programmer) GitHub. I want to learn. This would give me a goal to code. Where should I start at least? I look up this stuff at least once a year, when I realize how I will lose my beautiful screensavers and it's getting harder to make them work.... I look at it as this is how I'll conquer a mountain of Linux. I'm not a beginner, but I'm not a master. This is my journey. Any ideas?

Love, Techni
 
Nice write up. I wish I had the time to put into this. For now, I'm back to X11 so my xscreensaver can actually lock.
 
Nice write up. I wish I had the time to put into this. For now, I'm back to X11 so my xscreensaver can actually lock.
Brother you and me. Also, thank you. I assume you aren't being sarcastic. I feel so selfish wanting to take on such a big thing. This is all from the heart. People have lives. We all ebb and flow. I'd never, ever condemn or blame someone for having to focus on themself and their life. I just only wish and hope for the best in your life. I hope the hours seem short, the tests conquered and the lines shorter, but just as profitable. Or, whatever positive on positive that could happen for you.
Personally, I've found myself in a time where I could actually put said time into this kind of project, so I want to jump on it!

In regards to the issue, I hate it so much. Wayland has so many amazing things, and X11 (thank you for reminding me of the name used, I was blanking earlier. I'm studying Unix from the ground up so X Windows System is in my head rn), just has some good old school proofs in the pudding (but the code I've heard is a wreck), but Wayland and X11 will never, ever play together happily. As it stands, the X11 and Wayland stopgaps to make things work between the different GUIs are just bandages on a bigger issue. The last dev on X11's Screensavers even threw in the towel on it and welcomed someone to help in any way.

I want to so badly (and have for now over at least 2 years but too cowardly or busy to say a thing.) In the end it's a passion and a learning tool for me now. This is how I learned Linux to begin with. I knew nothing, now I know something. But, where to start with this??? I'm going to be contacting that last dev, but I was hoping I could get someone else to possibly give me another trail to follow. Or lead, or anything really. I hate how this is the eternal low key thing no one will deal with problem. If you know, just point me and I'll do the dirty work!
Really, the kick that pushed this boulder off the mountain was my wife. Her enjoying something I've enjoyed for years in that single instance was the catalyst (she also hoped to get those screensavers on her laptop....which is full on Wayland). I want to do this so badly personally too. I've wanted to do this so badly and now I have a number of motivation to do so. Wayland deserves the best screensavers Linux creators have either created or "ported" into XScreensavers. I want to be a part of that legacy. New and old Linux users deserve this. No matter how small it may seem!

Thank you iomari!
 
No sarcasm at all. I'm with you 100%.
I really want to start using Wayland but not at the expense of losing Xscreensaver.
Out of curiosity, which Linux distro are you using and which desktop?
I'm using Kubuntu 23.04. Plasma of course.
I got back into xscreensaver after many years when my default screen lock stopped working. Then I remembered my old friend and slapped myself for ever forgetting it.

I used to use xscreensaver over 10 years ago and somehow stopped using it.

But I'm back on track now. It should be the default for all distros.
 
Last edited:
No sarcasm at all. I'm with you 100%.
I really want to start using Wayland but not at the expense of losing Xscreensaver.
Out of curiosity, which Linux distro are you using and which desktop?
I'm using Kubuntu 23.04. Plasma of course.
I got back into xscreensaver after many years when my default screen lock stopped working. Then I remembered my old friend and slapped myself for ever forgetting it.

I used to use xscreensaver over 10 years ago and somehow stopped using it.

But I'm back on track now. It should be the default for all distros.
My apologies for not being responsive sooner!

I have MX Linux 19.4 running with Xfce as the desktop environment. This is how I've been able to keep X11 support. I also have Fedora 35 with Plasma though it is running in X11 as the graphics platform, and my wife has Kubuntu 22.04 with Plasma and is running X11 as well.
I completely understand about forgetting xscreensaver and remembering it. That was me 2 years ago. It's just so lovely to have since I'll have a lot of my machines running throughout the day on lower power but still with the screensaver enabled because there is nothing cooler than coming back into your office with all the screens showing something cool on them. It's the little things in life, and a LOT of cool screensavers have been created or ported into xscreensaver over the years and it would be a shame to just lose them. People still have desktops (the Fedora workstation was a laptop until the screen chassis started to crack and bend the motherboard, so now it's a full time desktop set up as a file/printer manager), and honestly, screensavers do have a usage case if you have an OLED screen.
I do agree it should be the default, but I do understand the conversion to Wayland. The X desktop is incredibly antiquated and there will be a point where it's just not supported unless you use a legacy distro and understand the huge risks with that.

This is why I want to work on getting xscreensaver ported over to Wayland. Bring a whole new generation the fun of screensavers, with all of the modern security and options of a new graphics platform.
 
We find that xlockmore - in combination with xautolock - works a treat in Puppyland.....but then, Puppy, too, is only just starting to explore the intricacies of Wayland. One of our devs is convinced it's the only way to go, because all the "big boys" are embracing it whole-heartedly (encouraged by RedHat, of course!)

The above-mentioned xautolock & xlockmore work under "X", of course (the package names are a dead give-away, aren't they? :p ) Me, I like the built-in "Atlantis" saver.......dolphins and sharks slowly swimming around under water.......very 'restful'.

atlantis.gif


I've no idea if these could be ported to Wayland, but it would be another step toward encouraging further uptake of the new display server.


Mike. ;)
 
Last edited:
Big kudos on the xscreensaver-Wayland guide – it's really helpful! Just an observation: at first, I was a bit lost with the VM part, thinking maybe I missed a previous discussion. It felt like it was aimed at folks who already had a setup going in a VM. After a re-read, it clicked that those with the pre-existing file are already ahead of the game, and the rest of us just need to start from scratch. Maybe we could adjust the guide to be super straightforward for us newbies? Your insights are gold!
 
I don't care if they are necessary or not. Were desktop wallpapers ever necessary? So why do we still have them?

I was looking into screensavers on wayland, and by now this is indeed possible. Thanks to the awesome work of a person called Manuel Stoeckl. But it is rather obscure and therefore I am posting here to spread the word a bit.
He ported the screensavers from xscreensaver to wayland in his project called wscreensaver
https://sr.ht/~mstoeckl/wscreensaver/
He also has a fork of swaylock to show them on the lockscreen:
https://github.com/mstoeckl
I have a post on my blog on how to compile and use those two https://leimstift.de/2023/12/12/getting-screensavers-to-work-on-wayland/
For Gentoo I made packages to install wscreensaver and the swaylock fork, I think for all other distros you have to compile manually.
 
I have no idea what language or where I should start. But I want to make all of the X Window System Screensavers available to Wayland and beyond. As in you can keep making new ones.
I think you should look into Manuels projects, he has some animations which can be used as screensavers or animated backgrounds written in Rust. https://git.sr.ht/~mstoeckl/rwalkbg https://git.sr.ht/~mstoeckl/shaderbg
Screensavers from xscreensaver are written in C though.

I totally get the vibes from this thread. I switched to wayland some months ago and I really missed my screensavers.
 
Thank you so much for this write up. I have it working on PopOS 24.04 with cosmic de alpha epoch 2.

Random issue: I have 3 total screens connected to my machine. Only 2 of them will display the screensaver. The documentation doesn't give much here other than xscreensaver_window passes the display id to the application.

Any ideas? Thank you in advance.
 
but then, Puppy, too, is only just starting to explore the intricacies of Wayland. One of our devs is convinced it's the only way to go, because all the "big boys" are embracing it whole-heartedly (encouraged by RedHat, of course!)

He needs to be shown the door (IMO). Why the feeling that the "big boys" have to be followed? I hope it doesn't come to the point where I have to ditch Linux for a BSD.
 
Xscreensaver keeps all the hacks in the /usr/libexec/xscreensaver (that's for Debian, dunno other distros). If you enter that dir, and issue e.g. $ ./flyingtoasters, you'll see it works no problem, even in Wayland, of course. GNOME, by the way, is not required tho it makes things even easier (I don't use it).

So, there's no need to learn C and re-invent the wheel Zawinsky did 500 years ago. The only thing necessary is the wrappers for Wayland:
  • a program to detect idle time (it exists: swayidle)
  • a program to execute a screensaver hack (bash)
  • a program to kill it later, and/or lock the screen (swaylock)
  • some Wayland window manager, I use hyprland.

Look here to know how to wrap it wall up with bash scripts. You basically have to take this script, adjust to your system, but both .sh files in an executable dir, then issue the 'swaylock' command at the bottom which in fact is your screensaver running in the background. Tested works.

 
Not even sure (other than for something pretty to see) why you need a screensaver. We no longer use CRT screens that can burn the image on the display. lcd, led and all current technology do not burn images on screens so screensavers are no longer necessary. If you don't want people looking while you are away you can lock the screen and it is blank. In fact that uses less power because the screen can sleep. screensavers use resources and power that do not need to be used. So unless you just like staring at pretty things, there is no reason for a screen saver. Therefore I would say screen savers are obsolete and irrelevant. A pointless throw back to early times.
 
Look Mate, i don't care why the OP here wanted a screensaver, I just said how to do this. When faced with a technical question, I don't analyze one's existential philosophy to persuade they're deluded and don't need the answer. Instead, I answer.
 
Look Mate, i don't care why the OP here wanted a screensaver, I just said how to do this. When faced with a technical question, I don't analyze one's existential philosophy to persuade they're deluded and don't need the answer. Instead, I answer.
you might want to adjust your attitude. That sort of attitude belongs on a windoze forum. it will not get you any friends here.

now as to my response, perhaps the OP thinks it is needed and now they know it is no longer a necessity. I also gave alternate methods so I did actually answer.

I see you are a new member so learn that your response with attitude to me is not tolerated here and is unnecessary.
 
My attitude is perfectly correct. If you feel offended (by being called "mate"), I wholeheartedly apologize.
Now, with that out of the way - I have observed, at an unsettling rate, that often in forums when asking a "stupid question" ppl are persuaded out of getting an answer. However, being an university teacher, I trust there are no stupid questions. And in a technical context (such as a Linux forum), for me, a "silly question" is just a challenge. So this is how I see this - as a challenge.

Wayland is less than X11 was, it's just a protocol aiming to replace it with myriads of software packages. But due to software atomization and lack of documentation, people are lost, I know I was. So if I can explain to one person that Wayland won't measure their idle time without extra software, that's a win.

I somehow don't feel really compelled to be going out of my way and explaining just why people still need screensavers. I'm not them, I didn't ask the question. But I can try: Because they're fun? Interesting? Cool? In case of Xscreensaver, they're in most cases thought-provoking, inspiring and mysterious. At least, that's why I use them.

And, let's be real, CRT burnout hasn't been an issue for 25y or so. There's long been different reasons for screensavers. Usually, locking the screen plus a 'visual representation of idle-ness'. But nowadays in Wayland, if you don't use Gnome, you can't just leave the laptop and expect it'll blank the screen and lock it. Just not happening.

As a closing argument don't mention Windows to me, I haven't used it in decades. I'm much more into HURD than Windows...
 


Latest posts

Top