xss-lock(1)
π xss-lock β the manual page, but make it cute π
okay so bestie, this is the manual for xss-lock(1), from the General Commands Manual section. it's a little program that lets your fave screen locker do the whole screen-saver thing. let's get into it π«Ά
β¨ NAME β¨
xss-lock β use external locker as X screen saver
πΈ SYNOPSIS πΈ
xss-lock [-n notify_cmd] [-s session ID] [--ignore-sleep] [-l] [-v|-q] [--] locker [arg] ...
xss-lock --help|--version
π¦ DESCRIPTION π¦
so xss-lock hooks up your favorite locker to the MIT screen saver extension for X, and to systemd's login manager. two boyfriends. iconic π
you should run xss-lock in your xsession β either by starting it in your .xsessionrc, or by other session-specific means (like your Window manager configuration, iykyk).
β οΈ heads up bestie:xss-lockruns in the foreground (i.e. it doesn't fork), so you may need to run it in the background. for example, by running it with&. don't forget the&or your whole session just sits there staring at you π
the locker gets executed in response to events from these two sources:
- X signals when screen saver activation is forced, or after a period of user inactivity (as set with
xset s TIMEOUT). in that latter case, the notifier command β if you specified one β is executed first. - The login manager can also request that the session be locked; as a result of
loginctl lock-sessions, for example. and on top of that,xss-lockuses the inhibition logic to lock the screen before the system goes to sleep. sleepy girl behavior π€
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. no cap.
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. very main character of it β¨
π OPTIONS π
-n cmd,--notifier=cmdβ Runcmdwhen the screen saver activates because of user inactivity. Shell-style quoting is supported. The notifier is killed with the signalSIGHUPwhen X signals user activity, or with signalSIGTERMwhen the locker is started. The locker is started after the first screen saver cycle, as set withxset s TIMEOUT CYCLE. If the screen saver cycle time is0, the notifier is not run and the locker is started immediately after timeout.
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. two scripts, two vibes π
-l,--transfer-sleep-lockβ Allow the locker process to inherit the file descriptor that represents the delay lock obtained from the login manager. The corresponding index will be made available in the environment variable$XSS_SLEEP_LOCK_FD; this will only be set if the reason for locking is that the system is preparing to go to sleep. The locker should close this file descriptor to indicate it is ready.
example scripts that wrap existing lockers are available as /usr/share/doc/xss-lock/transfer-sleep-lock-*.sh.
-s ID,--session=IDβ Use the session ID instead of the current session.
example: /usr/share/doc/xss-lock/xss-lock.service.
--ignore-sleepβ Do not lock on suspend/hibernate. (letting it slide fr fr π)-q,--quietβ Output only fatal errors.-v,--verboseβ Output more messages. she's chatty π¬-h,--helpβ Print help message and exit.--versionβ Print version number and exit.
π SIGNALS π
SIGHUPβ Upon receiving this signal,xss-lockresets the screen saver, but only if the screen is not currently locked (unlikexset s reset).
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: This is ineffective with mplayer2 (and mpv), because its heart keeps beating while playback is paused. π
SIGINT/SIGTERMβ Upon receiving this signal,xss-lockexits after killing any running notifier or locker.
π NOTES π
- Some applications rely on the
xdg-screensaverscript fromxdg-utils, which usesxset s offandxset s defaultto suspend and resume the screen saver, respectively. The latter resets the timeout and cycle to the server defaults (xset s onuses a hardcoded default instead), so this only works if you are happy with (or can control) the server settings.
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. patch it bestie, slay π§
β EXAMPLES β
- Use with xscreensaver via
.xsessionrc(hence in the background):
xscreensaver &
xss-lock -- xscreensaver-command --lock &
- Run xlock after ten minutes of inactivity:
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. not the glow-up we wanted π
- Dim the screen after three minutes of inactivity, lock the screen two minutes later using i3lock:
xset s 180 120
xss-lock -n dim-screen.sh -- i3lock -n
Note: A script is provided to use i3lock's forking mode with the --transfer-sleep-lock option (see above).
π₯ SEE ALSO π₯
loginctl(1), xset(1), systemd-logind.service(8)
π AUTHOR π
Raymond Wagenmaker <raymondwagenmaker@gmail.com>
and that's the whole page, bestie β written up back in November 2018 for the xss-lock(1) manual, and you just read all of it. ate and left no crumbs πβ¨ bye pookie π
π¦ where this page comes from
- ubuntu resolute: xss-lock 0.4.0-1 Β· MIT
- ubuntu stonking: xss-lock 0.4.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms