My contribution to xflock4

Jarno Suni sunijarno at gmail.com
Fri Mar 26 09:47:05 CET 2021


Hi,

I have made some changes to xflock4 shell script. That is currently
only on my local git branch as a single commit. I guess you want that
the result is done in more than one commit, because there are a few
changes, though it is extra work.

I Cc:ed this to user mailing list, too, because I am interested in
their comments.

Here are some related bug issues:
https://gitlab.xfce.org/xfce/xfce4-session/-/issues/17
https://gitlab.xfce.org/xfce/xfce4-session/-/issues/29

I tried to do the changes so that the modified xflock4 could be used
as such with older releases of Xfce4, too.

Below is the summary of the changes in git. Any comments?

    Add known lockers and features in xflock4

    Make xflock4 executable.

    Unset IFS to get expected word splitting for sure. Use bash settings
    to find errors more easily.

    If the script is run in terminal, apply 1 second delay before launching
    a screensaver to avoid unwanted effect when raising key up.

    'gnome-screensaver-command --lock' returns always 0, so it has to be
    handled specially. Tested on gnome-screensaver 3.6.1; the project
    seems to be unmaintained.

    Recognize new fallback screensavers:
    light-locker (which also turns audio off while locking)
    mate-screensaver
    cinnamon-screensaver

    Recognize new fallback lockers:
    i3lock
    xtrlock
    slimlock
    alock

    /general/LockCommand is evaluated with care so that user does not
    accidentally run e.g. a shell function, instead of a command, but user
    has an option to run shell commands by starting the line by ';', '&&'
    or '&' or by postfixing the initial command by '&'. User can pass
    quoted arguments for the desired command.

    Support new xfconf properties of xfce4-session channel:

    /general/LockCommandForks (boolean; default false):

    If the locker set in /general/LockCommand does not fork, this has to be
    false so that xflock4 exits before unlocking; it will exit one second
    after launching the command then.

    /general/LockSetDPMS (boolean, default is false):

    Whether to change DPMS setting for the locker. DPMS is never applied
    for fallback screensavers and always applied for fallback lockers.

    /general/LockInitialDelayDPMS (unsigned integer; default is 1):

    Apply DPMS mode after this initial delay in seconds after the locker is
    started. Actual delay is at least 1 second if /general/LockCommandForks
    is false.

    /general/LockDelayDPMS (unsigned integer; default is 15):

    Apply DPMS mode after this amount of time of inactivity in seconds.
    The old setting is restored after locker exits. This does not have an
    effect if /general/LockCommandForks is true. This does not have an
    effect either if the locker set in /general/LockCommand forks (because
    it exits right off).

    /general/LockModeDPMS (string with allowed values
    standby, suspend and off; default is off):

    Some DPMS mode might work better than other depending on system.


More information about the Xfce4-dev mailing list