xflock4: Improve support for lockers and DPMS (#17,#29)
Add some shell settings to make errors more noticeable and to improve robustness. Run the shell command read from Xfconf property /general/LockCommand in separate shell, if the property exists and is non-null. The property can be a complex shell one-liner that is encapsulated within xflock4. If the one-liner fails, xflock4 fail, too. Support new xfconf properties of xfce4-session channel: /general/LockCommandForks (boolean; default false): If LockCommand does not fork, this has to be false to get xflock4 exit before unlocking; it will exit not later than one second after launching the command then. If LockCommand exits by that time with non-zero exit status then xflock4 fails; otherwise it is regarded as succeeded. /general/LockSetDPMS (boolean, default is false): If true, change DPMS setting for the locker. The setting does not apply to fallback screensavers, though. /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. (Closes #29) /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. Recognize new screensaver: light-locker (which also turns audio off while locking) xscreensaver-command can take GNU style options so it can be called from the loop. '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. Remove hard-coded fallback lockers because user can specify which locker to use by LockCommand property. Update copyright.
Showing with 134 additions and 29 deletions