Qt-based screensaver for LXQt (optional for LXQt Power Management)?


#1

In the past I have been using xscreensaver what does not work that seamless with LXQt.

Is there any Qt-based alternative available for LXQt? Or even better: A integrated screensaver in LXQt power management?

In my case I want to lock the screen after five minutes but suspend the machine after 15 minutes. There are several options available within LXQt Power Management and via xscreensaver as well, but nevertheless it is necessary to run both programmes the same time. A slim and simple screensaver within lxqt-powermanagement would be awesome!


(Chris Rainey) #2

I, personally, use gnome-screensaver(daemonized) on my laptop(in order to catch lid-events fast enough to avoid the dreaded systemd-induced “screen exposures” upon wake-up events). LXQt in Lubuntu 18.10(Cosmic) will have a “Lock Screen” option in the LXQt power manager app which activates the xdg-screensaver script.

On my desktop, I use the lovely i3lock-fancy key-bound to Super-L and no power management from the desktop environment(i.e. just xset s off dpms 0 0 65535 in my session startup) and a custom script from the i3lock man page:

~$ cat .SCREEN-LOCKER.sh 
#!/bin/sh

revert() {
	xset s off dpms 0 0 65535
}
trap revert HUP INT TERM
xset +dpms dpms 0 0 10
i3lock-fancy 
revert

I simply prefer to lock my session manually on my desktop computer, when needed.

Another option, that works with the xdg-screensaver script is xautolock(i.e. xautolock -time 15 -locker '~/.SCREEN-LOCKER.sh' & with your choice of any/all screensaver’s / lockers.

HTH !!


(Alf Gaida) #3

@Zumbali - you might be surprised, there are only some screensavers that almost partly work in the wild. You might read Jamies blog regarding this. I’m not a fan of xscreensaver - but it is one of the things that work mostly.

@ckrzen - the screen locking via lxqt-powermanger is LXQt default, not ubuntu specific.


#4

Thanks a lot for your kind answers! :slightly_smiling_face:

Screen locking via lxqt-powermanagement requires some additional packages I guess? I uninstalled xscreensaver recently, and every time the screensaver would be activated now I will see an error message.

Which package do I need to use lxqt-powermanagement with a screen locker?

Would it be possible to add an additional option into the lxqt-powermanagement-package:

  1. Option: “Lock screen after (blabla) minutes”
  2. Option: “When idle then (blabla)”

I would love to use both options simultaneously: Screen locking after 5 minutes and suspending the machine after 15 minutes… Currently this is not possible I guess?


(Alf Gaida) #5

We right now default on xscreensaver to an extent - lxqt-powermanagement use xdg-screensaver as wrapper for some screensavers. So you need at least xdg-utils and a supported screensaver installed.


(Alf Gaida) #6

@ckrzen - sorry, you are plain wrong about systemd - it has nothing to do with starting xscreensaver to late. The trick is that the screen should be locked before entering suspend or hibernate - so the implementation in lxqt-powermanagement is not complete right now, we solved some big problems with screensaving before the last release and there is an open RC bug about: https://github.com/lxqt/lxqt/issues/1515

Edit: @zumbali - the lack of options in the powermanagement is intentional. One can use the basic options in lxqt-powermanagement or use the fine grained settings of the screensaver in charge.


(Chris Rainey) #7

@agaida: ahh … thanks for the link. I’ve been seeing this issue occur under various sessions(XFCE4, LXQt, etc.). The only explanation that I’ve read was in an XFCE4 forum where it was suggested that systemd(logind) was acting on the lid-event before the session manager to activate screen-locking. Is there any testing on this that would be helpful to you or do you believe it is resolved with lxqt-session/power?


(Alf Gaida) #8

@ckrzen - i guess you can reproduce a working locking behaviour without problems: open a terminal and type xdg-screensaver lock- with a laptop and proper set up lid switches - close the laptop. The laptop should now sleep or hibernate. Open the laptop and wake it up. Should work without glitches (at least it does for me yesterday). I get the behaviour you describe when i don’t lock the screen before sleeping or hibernating. So i guess it is just a fault in our code :smiley: - I’m on it (of course with a bit of help)


(Chris Rainey) #9

Thanks!


(Alf Gaida) #10

@ckrzen - but the guys in the XFCE forum was partly right too - have pasted the logind.conf in the bug, but i guess it is a good idea to do this here too:

/etc/systemd % cat logind.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
KillUserProcesses=yes       <--- i recommend this for desktop usage, debian default is no 
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5       <--- the 5s
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no    <--- depending on distribution defaults 
#HibernateKeyIgnoreInhibited=no  <--- depending on distribution defaults 
#LidSwitchIgnoreInhibited=yes    <--- depending on distribution defaults 
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

(Chris Rainey) #11

Nice!


#12

Thanks for that hint! Based on your reply there is one more question.

What is the intentional approach about separation of screensaver and lxqt-powermanagement:

  1. Simple screen locking with screensaver after xx minutes should be done in xscreensaver?

    and

  2. Suspending the machine after xx minutes should be done in lxqt-powermanagement?

Where would you draw the line which program is responsible for what? :grinning: I am asking, because xscreensaver could handle all by himself. However, it will collapse with lxqt-powermanagement if the “Suspend”-options are set simultaneously.


(Alf Gaida) #13

Very good question :smile: - the ui is a kind of abstraction layer so, yes, xscreensaver should be able to handle that alone. The intention is to be able to simply use other screensavers too. So i guess i would leave the actions to lxqt-powermanagement and the session. At least i do so with my laptops.


#14

Haha okay. :smile:

So you mean:

  1. Screen locking/screensaver will be executed by xscreensaver
  2. Suspending the machine will be done by lxqt-powermanagement

Is this correct? How do you avoid those “not locked” seconds after waking up the machine?


(Alf Gaida) #15

not really - all lxqt-powermanagement do is call the screensaver in charge - may it be xscreensaver or any other screensaver who is supported