xfce4-session: Backport lock command setting in xflock4

Up until xfce 4.13, xflock4 only had support for "whitelisted"
(*cough* hardcoded *cough*) locks screens. Version 4.13 added the
ability for the user to specify the lock command via the xfce
settings. This PR backports that functionality

https://github.com/xfce-mirror/xfce4-session/blob/xfce4-session-4.13.0/scripts/xflock4

authored by Gonzalo Andreani and committed by Yegor Timoshenko c9c1ccda ab754a40

+13 -4
+13 -4
pkgs/desktops/xfce/core/xfce4-light-locker.patch
··· 1 --- ./scripts/xflock4.orig 2017-08-06 23:05:53.807688995 +0100 2 +++ ./scripts/xflock4 2017-08-06 23:09:06.171789989 +0100 3 - @@ -24,10 +24,11 @@ 4 PATH=/bin:/usr/bin 5 export PATH 6 - 7 -# Lock by xscreensaver or gnome-screensaver, if a respective daemon is running 8 - +# Lock by xscreensaver, gnome-screensaver or light-locker, if a respective daemon is running 9 for lock_cmd in \ 10 "xscreensaver-command -lock" \ 11 - "gnome-screensaver-command --lock" 12 + "gnome-screensaver-command --lock" \ 13 + "light-locker-command -l" 14 do 15 - $lock_cmd >/dev/null 2>&1 && exit 16 done
··· 1 --- ./scripts/xflock4.orig 2017-08-06 23:05:53.807688995 +0100 2 +++ ./scripts/xflock4 2017-08-06 23:09:06.171789989 +0100 3 + @@ -24,12 +24,19 @ 4 PATH=/bin:/usr/bin 5 export PATH 6 + 7 -# Lock by xscreensaver or gnome-screensaver, if a respective daemon is running 8 + +# First test for the command set in the session's xfconf channel 9 + +LOCK_CMD=$(xfconf-query -c xfce4-session -p /general/LockCommand) 10 + + 11 + +# Lock by xscreensaver, gnome-screensaver, or light-locker, if a respective daemon is running 12 for lock_cmd in \ 13 + + "$LOCK_CMD" \ 14 "xscreensaver-command -lock" \ 15 - "gnome-screensaver-command --lock" 16 + "gnome-screensaver-command --lock" \ 17 + "light-locker-command -l" 18 do 19 + - $lock_cmd >/dev/null 2>&1 && exit 20 + + if [ ! -z "$lock_cmd" ]; then 21 + + $lock_cmd >/dev/null 2>&1 && exit 22 + + fi 23 done 24 + 25 + # else run another access locking utility, if installed