My contribution to xflock4

Jarno Suni sunijarno at
Sat Mar 27 20:27:31 CET 2021

In my local branch I also changed xfce-screensaver.c to lock by
xflock4 only, and even that synchronously like shown by Martin
Castillo (castilma at a.k.a. 2.acc.von in his patch for
for 4.14 at one
year ago.
And changed it not to start a screensaver daemon there i.e. disabled
everything in xfce_screensaver_setup(); though I think there is an
issue with xfce_screensaver_inhibit() then?! I suppose the power
manager needs some fixing, too, so that screensaver daemon starting
would be centralized in session autostart. There is related discussion

I don't know, if I have time to setup proper testing environment, so I
would like to give the modified branch to people for testing and I
(and/or someone else?) would polish it later, but I wonder if it is
bad to rebase it after pushing the branch?

Some may feel that xflock4 is ugly script, but it is handy to have a
command for locking in command line. I suppose xflock4 could be later
replaced by an executable binary, if there are good reasons for it.

Some concerns:
- If "lock screen before sleep" is set system should go to sleep only
after xflock4 has exited. xscreensaver is good for testing this, as it
has configurable "Fade to Black when Blanking" setting.
- In my testing there is an issue in locking by xscreensaver 5.42: It
sometimes fails with "xscreensaver-command: xscreensaver window
unexpectedly deleted." (I have reported the developer about this, but
he has not replied, yet.) It locks anyway and when xflock4 tries
i3lock as fallback, it fails:  "i3lock: Cannot grab pointer/keyboard"
- If "lock screen before sleep" is set and xflock4 fails, system
should not go to sleep. This may be an issue, if user has configured
system to go sleep when laptop lid is closed. Maybe there should be an
exception in this case and let sleeping happen without lock then. Or
could power manager give an alarming sound then to notify user?
- Settings at Application Autostart should be honored, but Xfconf
setting general/LockCommand may override this. If user sets the
property, Autostart should be set accordingly, but I think it is
user's responsibility.
-As for DPMS, i3lock used to have --dpms options, but it was later
removed due to some issues unknown to me. I could not contact the
developers. Manual page of i3lock says

       The  -d  (--dpms) option was removed from i3lock in version
2.8. There were plenty of use-cases that were not prop‐
       erly addressed, and plenty of bugs surrounding that feature.
While features are not normally removed  from  i3  and
       its tools, we felt the need to make an exception in this case.

       Users  who  wish  to explicitly enable DPMS only when their
screen is locked can use a wrapper script around i3lock
       like the following:

            revert() {
              xset dpms 0 0 0
            trap revert HUP INT TERM
            xset +dpms dpms 5 5 5
            i3lock -n

More information about the Xfce4-dev mailing list