Are there at least some plans to implement screensavers into Wayland? Is there any way to override Wayland’s restrictions and set a screensaver up?

  • tekato@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    27 days ago

    Set a systemd timer to start mpv in fullscreen with whatever you want as the screensaver in a loop

  • Maiq@piefed.social
    link
    fedilink
    English
    arrow-up
    4
    ·
    27 days ago

    Just installed xscreensaver and it works more or less. i don’t think it can screenlock but haven’t tested everything. Just popped up a terminal and ran xscreensaver-settings and it asked if I wanted to run the server. Picked a few savers off the list changed the times and waited. Only working on one desktop but that doesn’t bother me. A little buggy, hard to get it to stop with a mouse wiggle or keypress. Have to switch desktops and kill the pid. Better than it was a year ago though. Might work better in kde than in hyprland?

    Using Arch, wayland, xorg-wayland

  • Snot Flickerman@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    2
    ·
    27 days ago

    I’m on Kubuntu 24.04 and I got xscreensaver working in Wayland.

    You have to log into an X11 session first and set up xscreensaver how you want it. Once it’s set up and working, log out of the X11 session and log back into the Wayland session.

    Go to the System Settings and look for Autostart. Make an autostart entry for xscreensaver here. Then check the xscreensaver.desktop file that created and make sure it looks like this:

    [Desktop Entry]
    Comment[en_US]=
    Comment=
    Exec=xscreensaver --no-splash
    GenericName[en_US]=
    GenericName=
    Icon=xscreensaver
    MimeType=
    Name[en_US]=XScreenSaver
    Name=XScreenSaver
    Path=
    StartupNotify=true
    Terminal=false
    TerminalOptions=
    Type=Application
    X-KDE-SubstituteUID=false
    X-KDE-Username=
    X-Ubuntu-Gettext-Domain=xscreensaver
    

    As long as this is set to autostart, you will have a working xscreensaver in Kubuntu, if nothing else. I cannot confirm it working on any other systems and you absolutely do need both X11 and Wayland as sign in options for this to work. If you want to change settings you will have to switch back to X11 or I use scripts to edit the .xscreensaver configuration file.

    For example I wrote two small python scripts for changing the length of time before the screen saver activates, and use cron to run them in the morning and evening. This is the one for the morning:

    import os
    import sys
    import fileinput
    
    # Read in the file
    with open('.xscreensaver', 'r') as file:
      filedata = file.read()
    
    # Replace the target string
    filedata = filedata.replace('timeout:	0:05:00', 'timeout:	1:00:00')
    
    # Write the file out again
    with open('.xscreensaver', 'w') as file:
      file.write(filedata)
    

    The morning script changes the timeout to five minutes, and the evening script changes is to an hour, making it a simple find and replace a string for both since we’re just rotating numbers.

    and this is what it would look like in your crontab:

    0 7 * * * python3 /home/yourusername/screensavermorning.py

  • Bonje@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    27 days ago

    Might be able to with a quickshell. Some of them have idle timeout plugins then just start mpv or terminal pipes in full screen.

  • picandocodigo@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    6
    ·
    27 days ago

    Until they fix being able to use screensavers -XScreenSaver at the very least- on Wayland, we’ll never have the “Year of Linux on the desktop".

    • Snot Flickerman@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      27 days ago

      My solution was to set up xscreensaver how I wanted it in X11 and then start it via CLI as a background app on system startup for wayland.

      You can’t manage screensaver settings from wayland, but you can force it into working.

      I’m on Kubuntu 24.04

  • whatiswrongwithyou@lemmy.ml
    link
    fedilink
    arrow-up
    3
    arrow-down
    9
    ·
    26 days ago

    Welcome to using Wayland, where no one cares what you want and it’s out of scope and actually you’re out of line for wanting it, get with the times!

    You can graft xscreensaver in but the extent to which it will work is wholly dependent on your environment. Wayland provides the protocols, not implementations, so you may be running something that surfaces hooks for making xscreensaver work and you may not.

    Lest this just be about showing pretty pictures, there have been numerous times when some desktop environment has decided to staple the pretty pictures part of xscreensaver on to its own locker (most famously to get matching window decorations when the computer asks for a password) and ended up with very funny bugs (most famously the “smash keyboard to bypass lock”).