I want to Create a slideshow lockscreen using the GNOME desktop. I am running Ubuntu 16.04 LTS.

I am particularly talking about the "lockscreen" not the Login screen, and definitely not the wallpaper...

It should basically be like Windows spotlight.

Any help will be highly appreciated,

  • The duplicate candidate has many answers for slideshows. Many work on the lock screen. – WinEunuuchs2Unix Feb 19 '18 at 14:51

This is what I've come up with so far. I'm not a very experienced bash programmer, so I'm sure there are improvements that could be made both for readability and efficiency, but this is what I got to work after hours of finagling.


xset s off    # This turns off the "screensaver" feature (not actually a screensaver, just an annoying power saving feature.)
xset -dpms    # Turns off dpms (desktop power management system -- also annoying)

while true; do
    gsettings set org.gnome.desktop.screensaver picture-uri /WALLPAPERS/"$(ls /WALLPAPERS/ | sort -R | tail -n 1)"
    sleep 30    # This is the amount of time in seconds to wait before changing

Where "WALLPAPERS" is the full path to the parent directory of whatever image(s) you want to set on the lock screen.

Save this script with whatever name you want e.g. lockscreen-slideshow.sh -- just make sure you know where it's being saved to. You'll also need to make it executable, which you can do in a terminal with chmod +x lockscreen-slideshow.sh

Lastly, you'll want to add a startup script so you don't have to open a terminal and run your script manually every time you log in, so make a new file in ~/.config/autostart/ e.g. "lockscreen-slideshow.desktop" and drop this copy pasta into that bowl, then modify it to reflect the right path.

[Desktop Entry]
Comment=fetch a random anime wallpaper and plaster it to the lock screen

Something to note: this is a slideshow in a very loose sense. It'll just swap the images out instantaneously. I haven't figured out how to make them transition smoothly yet, but I'm playing with adding new keys to gsettings schema (and then subsequently copying the key from org.gnome.nautilus.desktop called background-fade over to org.gnome.desktop.screensaver).

Hope this helps for now.

|improve this answer|||||
  • Thank you, I haven't tested it out yet, but it seems to be exactly what I was looking for. I'm thinking removing your sleep, randomising the image and dumping it as an hourly cron job. – XChikuX Feb 19 '18 at 22:32
  • Sure thing. I've also considered using the "built-in" method of the xml file, but instead of using a statically defined image, randomly generating the image to display with a script, and then writing over the xml. I'm not too familiar with cron jobs either, but as I understand it the xml file is structured similarly (if not identically) to a cron job, and so probably is essentially that. There're all kinds of sample xmls and sample cron jobs on Stack Overflow, askubuntu, etc out there. If I bundle this into a package I'll post here again. Next step is adding transition effects. – Anon Feb 20 '18 at 2:10
  • I tested it out. Works fine. A cron job is simple. You just use "crontab -e" and add the location of your script. To make it hourly you just prefix it with @hourly <path_to_script>. Then save the file. – XChikuX Feb 20 '18 at 5:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.