Simple way of temporarily disabling screensaver

Hi all, :wave:

I wonder if anyone of you kind folks could help me.

I need a simple way of temporarily disabling the screensaver in Lubuntu 20.04.3 LTS.

Background:

I often let my system read out text from the browser/pdf etc. to me. I once wrote a dedicated script for that purpose.

Whenever the reading itself takes longer than 10 minutes or so (and if I don´t use my mouse in the meantime) my screensaver kicks in.
Of course this isn´t a huge problem by itself as I just have to move my mouse a bit to get my display back but it got me wondering:

Wouldn´t there be an uncomplicated solution (a simple command via CLI would do) for temporarily disabling the screensaver?

I´ve looked around a bit and found caffeine (Caffeine in Launchpad) as a possible solution. Yet I´d have to install the programme and see how it works. But perhaps this might be an overkill?
I´d rather prefer the CLI. :blush:

So a simple command would be perfect (as I use fish as my default-shell; not even the need to define an alias for that matter).
[For fish: https://fishshell.com/ ]

Perhaps:

xset s off
and later
xset s on

(man xset says: “xset - user preference utility for X”; “The s option lets you set the screen saver parameters”)

What do you think? Or do you know something simpler/better :question:

Thanks a lot in advance for your help.

Many greetings.
Rosika :slightly_smiling_face:

1 Like

Hi all, :wave:

for anyone interested:

in the meantime I stumbled upon a “mystery” which could be solved.

I was wondering whether xset could be put to good use but it turned out it couldn´t. :blush:

man xset says:

xset - user preference utility for X […]The s option lets you set the screen saver parameters

But xset q produced a curious output:

[...]
Screen Saver:
  prefer blanking:  yes    allow exposures:  yes
  timeout:  0    cycle:  0
  [...]

That´s a bit funny because after about 10 minutes the screensaver still kicks in despite the setting of “timeout: 0”. :thinking:
That seems to be the default setting as I never changed anything.

I compared that with Debian10 which I have installed as a VM. Here the default settings seem to be correct: “timeout: 600”.

Chris (guiverc) from Lubuntu support helped me by pointing out that

Options to xscreensaver are stored in one of two places: in a .xscreensaver file in your home directory; or in the X resource database. If the .xscreensaver file exists, it overrides any settings in the resource database.

(Question regarding xscreensaver - Lubuntu Support - Lubuntu Discourse )

And that´s the case with me.

The timeout value in ~/.xscreensaver is set to 10 minutes.

The only thing to do seems to be

The suggested xscreensaver-demo command lets you change the settings pretty easily (ie. change Mode to Disable maybe).

which is via GUI; so no command-line solution here. :slightly_frowning_face:

Many greetings
Rosika :slightly_smiling_face:

Try putting a 1 or 2 in there instead, the reason why is when I set Apport messaging to 1 it switches it off. Apport is a program in Ubuntu error displaying program which alerts the user if there are any errors. I always switch it off using a 1, 0 will keep it on. Reboot afterwards to save the setting. Also try rebooting after adding 0.

Hi Mark, :wave:

thanks for the suggestion.

But I wonder: as guiverc (see above) pointed out the .xscreensaver file overrides the other settings.
So even if I could change the timeout-settings with xset (and I wouldn´t know how to do this) it might not have any effect.

Besides: I don´t want to disable xsreensaver permanently, just temporarily (for the duration of my tts-script).

I was therefore looking for a simple command via CLI without the need to reboot (which seems counter-intuitive for my purposes).

Never mind. All that seems to be some kind of “luxury problem” … :blush:

Thanks again and many greetings.
Rosika :slightly_smiling_face:

BTW:

I just found out about xscreensaver-command :

https://www.commandlinux.com/man-page/man1/xscreensaver-command.1.html

I still have to take a closer look at the page to find out whether that´ll provide something useful. :slightly_smiling_face:

What about just extending the time to say three hours of when it goes to screensaver? Is there no GUI at all?

1 Like

This was happening to me the other day on my 21.04 Lenovo E495 Ryzen 5 system the other day and annoying the shit out of me so I did this (the other day) :

gsettings set org.gnome.desktop.screensaver lock-enabled false

But also - if you want it on again you can do this :

gsettings set org.gnome.desktop.screensaver lock-enabled true

I know that says “lock-enabled” - but in my case, it was going into power save, but not locked on wake up - above CLI stopped that… screen never blanks now, power save never comes on now, and it never locks…

2 Likes

Damn I did not think of that, as the gsettings command is how I get Nemo file manager to be default in every Linux OS I try. Incidentally, that leads me to my next point. I am busy making my own XFCE OS without Snaps or Flatpaks, using a mixture of Debian and App-Images. I’m making it in Virtualbox through a brilliant app called Cubic to make the final ISO up. It’s called Smooth OS, which no doubt there is already one called that? Based on Xubuntu 20.04, without anything Xubuntu inside it and have gotten rid of the Screensaver, as it just isn’t needed these days.

The only time of course is maybe if you’re running a desktop from the late 80’s going through to a CRT monitor, or using a CRT as your everyday monitor?? I even uninstall Screensaver in Ubuntu Mate. If you’re worried about privacy with friends around looking at what you’re doing on your computer, just lock it down usually Ctrl+Alt +Backspace will log you out, still leaving your apps open to come back to later, Here in Linux Mint XFCE it’s that very combination. I don’t know what it is in Lubuntu?

1 Like

Hi all, :wave:

sorry that I couldn´t reply earlier.

Many thanks to all those new answers of yours. :heart:

@clatterfordslim:

You´re right of course.
Yes, there´s a GUI for xscreensaver. It´s invoked by the command xscreensaver-demo.
It´s currently set to “blank after 10 minutes” and this value can be changed of course.

Thanks, Mark, for bringing this up. :wink:

Off the top of my head I wouldn´t know that either. Must do some research first. Sorry.

@daniel.m.tripp:

and

Thanks. This seems interesting. :smiley:

Nevertheless I´m a bit confused now.
As Lubuntu 20.04 makes use of the LXQT DE I wouldn´t have expected to encounter
something relating to GNOME.

But gsettings list-schemas informed me of having org.gnome.desktop.screensaver on my system. :thinking:

I tried the first command you provided
gsettings set org.gnome.desktop.screensaver lock-enabled false
and took a look at the reults with dconf-editor. And the command really worked.

So I´d have to try it out now.

I´m still a bit confused as to the xscreensaver / gnome.desktop.screensaver mystery.

In the meantime: many thanks once more. :smiley:

Many greetings to all of you from Rosika :slightly_smiling_face:

1 Like

Hi all, :wave:

in the meantime I had the chance to try the command

which Dan kindly provided.

Alas it didn´t work out. :slightly_frowning_face:
I very much suspect it´s the case of what Chris (guiverc) was referring to (see post #2 )
when he said:

Options to xscreensaver are stored in one of two places: in a .xscreensaver file in your home directory; or in the X resource database. If the .xscreensaver file exists, it overrides any settings in the resource database.

So - as Mark rightly pointed out - using the GUI (xscreensaver-demo) for changing the respective value still seems a way of doing it (perhaps the only way). :blush:

Never mind; thanks so much to all of you for your kind help. :heart:

Many greetings.
Rosika :slightly_smiling_face:

1 Like