XSS-LOCK(1) | General Commands Manual | XSS-LOCK(1) |
xss-lock - use external locker as X screen saver
xss-lock [-n notify_cmd] [-s session ID] [--ignore-sleep] [-l] [-v|-q] [--] locker [arg] ... xss-lock --help|--version
xss-lock hooks up your favorite locker to the MIT screen saver extension for X and also to systemd's login manager.
xss-lock should be run in your xsession either by starting it in your .xsessionrc or by other session specific means (e.g. Window manager configuration). Note that xss-lock runs in the foreground (i.e. doesn't fork) and therefore you may need to run it in the background (for example by running with &).
The locker is executed in response to events from these two sources:
xss-lock waits for the locker to exit -- or kills it when screen saver deactivation or session unlocking is forced -- so the command should not fork.
Also, xss-lock manages the idle hint on the login session. The idle state of the session is directly linked to user activity as reported by X (except when the notifier runs before locking the screen). When all sessions are idle, the login manager can take action (such as suspending the system) after a preconfigured delay.
This can be used to run a countdown or (on laptops) dim the screen before locking. For an example, see the script /usr/share/doc/xss-lock/dim-screen.sh.
For an example on how to use the two different signals received by the notifier command, see the script /usr/share/doc/xss-lock/dim-screen2.sh.
Example scripts that wrap existing lockers are available as /usr/share/doc/xss-lock/transfer-sleep-lock-*.sh.
Example: /usr/share/doc/xss-lock/xss-lock.service.
This can be used in MPlayer's configuration as a workaround for MPlayer's failure to restart the screen saver timer when playback is paused:
heartbeat-cmd="killall -HUP xss-lock" stop-xscreensaver=false
NOTE:
To fix the resume action in this script (or a copy in ~/bin preceding the original in $PATH), either replace on by your preferred timeout and cycle, or avoid hardcoded time values by patching the script to run a suspend loop as it does for other screen savers, using /usr/share/doc/xss-lock/xdg-screensaver.patch.
xscreensaver & xss-lock -- xscreensaver-command --lock &
xset s 600 xss-lock xlock +resetsaver
Without +resetsaver, xlock forces a screen saver reset during startup, thereby telling xss-lock to immediately kill xlock again.
xset s 180 120 xss-lock -n dim-screen.sh -- i3lock -n
NOTE:
Raymond Wagenmaker <raymondwagenmaker@gmail.com>
November 2018 |