xss-lock.1 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "XSS-LOCK" 1 "November 2013" "" ""
  4. .SH NAME
  5. xss-lock \- use external locker as X screen saver
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  33. .SH SYNOPSIS
  34. .nf
  35. xss\-lock [\-n \fInotify_cmd\fP] [\-\-ignore\-sleep] [\-l] [\-v|\-q] [\-\-] \fIlocker\fP [\fIarg\fP] ...
  36. xss\-lock \-\-help|\-\-version
  37. .fi
  38. .sp
  39. .SH DESCRIPTION
  40. .sp
  41. \fBxss\-lock\fP hooks up your favorite locker to the MIT screen saver extension
  42. for X and also to systemd\(aqs login manager. The locker is executed in response
  43. to events from these two sources:
  44. .INDENT 0.0
  45. .IP \(bu 2
  46. X signals when screen saver activation is forced or after a period of user
  47. inactivity (as set with \fBxset s TIMEOUT\fP). In the latter case, the notifier
  48. command, if specified, is executed first.
  49. .IP \(bu 2
  50. The login manager can also request that the session be locked; as a result of
  51. \fBloginctl lock\-sessions\fP, for example. Additionally, \fBxss\-lock\fP uses the
  52. inhibition logic to lock the screen before the system goes to sleep.
  53. .UNINDENT
  54. .sp
  55. \fBxss\-lock\fP waits for the locker to exit \-\- or kills it when screen saver
  56. deactivation or session unlocking is forced \-\- so the command should not fork.
  57. .sp
  58. Also, \fBxss\-lock\fP manages the idle hint on the login session. The idle state
  59. of the session is directly linked to user activity as reported by X (except
  60. when the notifier runs before locking the screen). When all sessions are idle,
  61. the login manager can take action (such as suspending the system) after a
  62. preconfigured delay.
  63. .SH OPTIONS
  64. .INDENT 0.0
  65. .TP
  66. .BI \-n \ cmd\fR,\fB \ \-\-notifier\fB= cmd
  67. Run \fIcmd\fP when the screen saver activates because of user
  68. inactivity. Shell\-style quoting is supported. The notifier is
  69. killed when X signals user activity or when the locker is
  70. started. The locker is started after the first screen saver
  71. cycle, as set with \fBxset s TIMEOUT CYCLE\fP\&.
  72. .sp
  73. This can be used to run a countdown or (on laptops) dim the
  74. screen before locking. For an example, see the script
  75. \fI/usr/share/doc/xss\-lock/dim\-screen.sh\fP\&.
  76. .TP
  77. .B \-l\fP,\fB \-\-tranfer\-sleep\-lock
  78. Allow the locker process to inherit the file descriptor that
  79. represents the delay lock obtained from the login manager. The
  80. corresponding index will be made available in the environment
  81. variable \fB$XSS_SLEEP_LOCK_FD\fP; this will only be set if the
  82. reason for locking is that the system is preparing to go to
  83. sleep. The locker should close this file descriptor to indicate
  84. it is ready.
  85. .sp
  86. Example scripts that wrap existing lockers are available as
  87. \fI/usr/share/doc/xss\-lock/transfer\-sleep\-lock\-*.sh\fP\&.
  88. .TP
  89. .B \-\-ignore\-sleep
  90. Do not lock on suspend/hibernate.
  91. .TP
  92. .B \-q\fP,\fB \-\-quiet
  93. Output only fatal errors.
  94. .TP
  95. .B \-v\fP,\fB \-\-verbose
  96. Output more messages.
  97. .TP
  98. .B \-h\fP,\fB \-\-help
  99. Print help message and exit.
  100. .TP
  101. .B \-\-version
  102. Print version number and exit.
  103. .UNINDENT
  104. .SH SIGNALS
  105. .INDENT 0.0
  106. .TP
  107. .B SIGHUP
  108. Upon receiving this signal, \fBxss\-lock\fP resets the screen saver, but only
  109. if the screen is not currently locked (unlike \fBxset s reset\fP).
  110. .sp
  111. This can be used in MPlayer\(aqs configuration as a workaround for MPlayer\(aqs
  112. failure to restart the screen saver timer when playback is paused:
  113. .INDENT 7.0
  114. .INDENT 3.5
  115. .sp
  116. .nf
  117. .ft C
  118. heartbeat\-cmd="killall \-HUP xss\-lock"
  119. stop\-xscreensaver=false
  120. .ft P
  121. .fi
  122. .UNINDENT
  123. .UNINDENT
  124. .sp
  125. \fBNOTE:\fP
  126. .INDENT 7.0
  127. .INDENT 3.5
  128. This is ineffective with mplayer2 (and mpv), because its heart
  129. keeps beating while playback is paused.
  130. .UNINDENT
  131. .UNINDENT
  132. .TP
  133. .B SIGINT/SIGTERM
  134. Upon receiving this signal, \fBxss\-lock\fP exits after killing any running
  135. notifier or locker.
  136. .UNINDENT
  137. .SH NOTES
  138. .INDENT 0.0
  139. .IP \(bu 2
  140. Some applications rely on the \fBxdg\-screensaver\fP script from xdg\-utils,
  141. which uses \fBxset s off\fP and \fBxset s default\fP to suspend and resume the
  142. screen saver, respectively. The latter resets the timeout and cycle to the
  143. server defaults (\fBxset s on\fP uses a hardcoded default instead), so this
  144. only works if you are happy with (or can control) the server settings.
  145. .sp
  146. To fix the resume action in this script (or a copy in \fI~/bin\fP preceding the
  147. original in \fB$PATH\fP), either replace \fBon\fP by your preferred timeout and
  148. cycle, or avoid hardcoded time values by patching the script to run a suspend
  149. loop as it does for other screen savers, using
  150. \fI/usr/share/doc/xss\-lock/xdg\-screensaver.patch\fP\&.
  151. .UNINDENT
  152. .SH EXAMPLES
  153. .INDENT 0.0
  154. .IP \(bu 2
  155. Run \fBxlock\fP after ten minutes of inactivity:
  156. .INDENT 2.0
  157. .INDENT 3.5
  158. .sp
  159. .nf
  160. .ft C
  161. xset 600
  162. xss\-lock xlock +resetsaver
  163. .ft P
  164. .fi
  165. .UNINDENT
  166. .UNINDENT
  167. .sp
  168. Without \fB+resetsaver\fP, \fBxlock\fP forces a screen saver reset during
  169. startup, thereby telling \fBxss\-lock\fP to immediately kill \fBxlock\fP again.
  170. .IP \(bu 2
  171. Dim the screen after three minutes of inactivity, lock the screen two minutes
  172. later using \fBi3lock\fP:
  173. .INDENT 2.0
  174. .INDENT 3.5
  175. .sp
  176. .nf
  177. .ft C
  178. xset 180 120
  179. xss\-lock \-n dim\-screen.sh \-\- i3lock \-n
  180. .ft P
  181. .fi
  182. .UNINDENT
  183. .UNINDENT
  184. .sp
  185. \fBNOTE:\fP
  186. .INDENT 2.0
  187. .INDENT 3.5
  188. A script is provided to use \fBi3lock\fP\(aqs forking mode with the
  189. \fB\-\-tranfer\-sleep\-lock\fP option (see above).
  190. .UNINDENT
  191. .UNINDENT
  192. .UNINDENT
  193. .SH SEE ALSO
  194. .sp
  195. \fBxset\fP(1),
  196. \fBsystemd\-logind.service\fP(8)
  197. .SH AUTHOR
  198. Raymond Wagenmaker <raymondwagenmaker@gmail.com>
  199. .\" Generated by docutils manpage writer.
  200. .