HOW TO: add xscreensaver themes to Xfce Screensaver

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
davemx
Posts: 320
Joined: Sun Aug 12, 2018 2:31 pm

HOW TO: add xscreensaver themes to Xfce Screensaver

#1 Post by davemx »

EDIT: I've added another line to the script, the one near the end containing "Hidden=true". It worked without it, but added a load of unwanted entries in Whisker Menu's Settings submenu. That is now fixed.

With the latest MX23, XFCE screensaver is back in the Settings Manager, but without much choice of screensaver. But you can make xscreensaver themes run in it.

I use Synaptic package manager for this, doing a search for xscreensaver, and installing all the packages that begin with xscreensaver but not xscreensaver itself.

As root, create the following file as /usr/local/bin/xfce4-set-up-screensavers

Code: Select all

#!/bin/bash

##Declare locations
dirsource=/usr/share/xscreensaver/config
dirdest=/usr/share/applications/screensavers
direxec=/usr/libexec/xscreensaver

##go to screensaver config folder
cd $dirsource

##for each file, extract the screensaver's filename and public name
##and build a desktop file
##Remember that a single > begins a new file, possibly erasing an
##existing one, and >> adds a line to a file.

##1. Get the line that contains the names.
##2. They are between double quotes, so using " as a delimiter
##   splits the line into 5 strings, we want the 2nd and 4th.
##3. The last line has to be single-quoted because there is a semicolon
##   character in it.

for f in ./*.xml; do
    gg=`cat "$f" | grep "screensaver name"`
    ggfile=`echo $gg | cut -d'"' -f2`
    ggname=`echo $gg | cut -d'"' -f4`
    echo [Desktop Entry] > $dirdest/"$ggfile".desktop
    echo Type=Application >> $dirdest/"$ggfile".desktop
    echo Name="$ggname" >> $dirdest/"$ggfile".desktop
    echo Exec=$direxec/"$ggfile" -root >> $dirdest/"$ggfile".desktop
    echo TryExec=$direxec/"$ggfile" >> $dirdest/"$ggfile".desktop
    echo 'Categories=Screensaver;' >> $dirdest/"$ggfile".desktop
    echo Hidden=true >> $dirdest/"$ggfile".desktop
done
Make the file executable.

Run It As Root. Hey Presto, you have a huge list of screensavers available in the XFCE screensaver applet.

If, at any time in the future, you add to your list of xscreensaver themes, run the script again. It will build the .desktop files up again from scratch.
Last edited by davemx on Fri Aug 18, 2023 9:31 am, edited 1 time in total.
Desktop: Mini-Box M350 with Asus H110i-plus motherboard, Pentium G4600 processor, 2TB SSD and 16Gb RAM DDR4-2133
Printer/Scanner: Brother MFC-J5335W
Laptop: Lenovo V15 ADA
Media Centre: Lenovo Q190

User avatar
CharlesV
Administrator
Posts: 8111
Joined: Sun Jul 07, 2019 5:11 pm

Re: HOW TO: add xscreensaver themes to Xfce Screensaver

#2 Post by CharlesV »

This is good info - thank you!

I have once again been saddened by the xfce screensaver issues and have bailed to use xscreensaver, which seems to resolve a bunch of issues AND get's me my images too. Since I lock everything before walking away from the keyboard, it works well and on the rare times I walk away and dont do that, or a 1 min away takes 10 ;-p ... it seems to lock nicely and not cause issues either. )
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

davemx
Posts: 320
Joined: Sun Aug 12, 2018 2:31 pm

Re: HOW TO: add xscreensaver themes to Xfce Screensaver

#3 Post by davemx »

I've noticed that xflock4 doesn't work, and I've changed the command in Whisker Menu to xfce4-screensaver-command -a.

The other thing (maybe not relevant to this, but possibly is) I can't find is where in the settings I can force Hibernate onto the exit menu.
Desktop: Mini-Box M350 with Asus H110i-plus motherboard, Pentium G4600 processor, 2TB SSD and 16Gb RAM DDR4-2133
Printer/Scanner: Brother MFC-J5335W
Laptop: Lenovo V15 ADA
Media Centre: Lenovo Q190

User avatar
l0dr3
Posts: 463
Joined: Wed Jun 28, 2023 11:06 am

Re: HOW TO: add xscreensaver themes to Xfce Screensaver

#4 Post by l0dr3 »

davemx wrote: Thu Aug 17, 2023 1:45 pm I've noticed that xflock4 doesn't work, and I've changed the command in Whisker Menu to xfce4-screensaver-command -a.

The other thing (maybe not relevant to this, but possibly is) I can't find is where in the settings I can force Hibernate onto the exit menu.
MX Tweak | Config Options ... last entry/choice (on MX23 XFCE) ;)

davemx
Posts: 320
Joined: Sun Aug 12, 2018 2:31 pm

Re: HOW TO: add xscreensaver themes to Xfce Screensaver

#5 Post by davemx »

l0dr3 wrote: Thu Aug 17, 2023 1:55 pm
MX Tweak | Config Options ... last entry/choice (on MX23 XFCE) ;)
That's the first place I looked, but that setting is not showing in MX Tweak on my desktop. I am seeing 10 checkboxes under Config Options in MX Tweak, the last of which is "Disable shortening of long file names on desktop". Strange.
Desktop: Mini-Box M350 with Asus H110i-plus motherboard, Pentium G4600 processor, 2TB SSD and 16Gb RAM DDR4-2133
Printer/Scanner: Brother MFC-J5335W
Laptop: Lenovo V15 ADA
Media Centre: Lenovo Q190

User avatar
l0dr3
Posts: 463
Joined: Wed Jun 28, 2023 11:06 am

Re: HOW TO: add xscreensaver themes to Xfce Screensaver

#6 Post by l0dr3 »

This is how it looks on my installation (MX23 x64 AHS) ...
Screenshot_2023-08-18_14-48-40.jpg
1.) do you have enough swap space allocated?
2.) did you *accidentally* disable hibernation support during install?
You do not have the required permissions to view the files attached to this post.

davemx
Posts: 320
Joined: Sun Aug 12, 2018 2:31 pm

Re: HOW TO: add xscreensaver themes to Xfce Screensaver

#7 Post by davemx »

l0dr3 wrote: Fri Aug 18, 2023 8:52 am This is how it looks on my installation (MX23 x64 AHS) ...
Screenshot_2023-08-18_14-48-40.jpg

1.) do you have enough swap space allocated?
2.) did you *accidentally* disable hibernation support during install?
THANKS!! Totally helpful, because the explanation about insufficient swap space got me to check why. When I installed MX23, I declared /dev/sda5, a 16Gb partition, as swap. It didn't need reformatting because it was already there as swap. For whatever reason, the installer didn't put that partition in /etc/fstab, so I didn't actually have any swap. I edited /etc/fstab and added the resume partition using grub customizer, and now all seems to be working.

Returning to the original purpose of this thread, I have edited the original post to prevent a load of screensaver entries (which don't actually work) from turning up in the Whisker Menu under Settings.
Desktop: Mini-Box M350 with Asus H110i-plus motherboard, Pentium G4600 processor, 2TB SSD and 16Gb RAM DDR4-2133
Printer/Scanner: Brother MFC-J5335W
Laptop: Lenovo V15 ADA
Media Centre: Lenovo Q190

Post Reply

Return to “Tips & Tricks by users (not for help)”