X11LOCK(1) SysV X11LOCK(1)
NAME
x11lock - completely lock up an X11 display
SYNOPSIS
x11lock [options]
DESCRIPTION
x11lock presents a small window to the user which may be activated with
the mouse to lock the X display. The display then has three states:
unlocked; locked and visible; or locked and covered. All mouse and
keyboard events (including the "ctrl-shift-reset" exit from X Windows)
are captured by the x11lock program when the display is locked, thereby
preventing any use of the display.
To lock the display and leave it visible, click the mouse over the LOCK
pushbutton on the x11lock window. This will change the mouse cursor to a
padlock (to indicate the locked state) and will disable the display, but
will otherwise leave the display unchanged. The display is not updated
and current commands are not executed until the lock is released.
To lock and hide the display, click the mouse over the COVER pushbutton
on the x11lock window. This will cover the display with a full-screen
window. The covering window will occasionally raise itself to the top so
that it will cover any new windows that are created on the display. When
any input is detected, a status message showing that the display is
locked is shown until the next update timeout occurs.
After it has been locked, the user must type in a valid password to
recover the use of the display. By default, the two valid passwords are
the password of the owner of the x11lock process and the password of the
superuser. When entering a password, the # character is defined as
erase, and the @ character is defined as kill.
x11lock can be terminated at any time during the unlocked state simply by
moving the cursor into the window and pressing ctrl-C. If you decide to
kill x11lock while it is in the locked state, you should use the polite
software termination signal SIGTERM. x11lock will gracefully unlock the
screen and then die. If you use the impolite signal SIGKILL, you might
not regain control of the "ctrl-shift-reset" capability. Other than
that, your display should be usable.
OPTIONS
x11lock supports the following standard X Toolkit options:
-display <display> display to use. This is of the form
<host>:<display>.<screen>. Default is to use the
value from the DISPLAY environment variable.
Note: it is considered rude to throw a lock onto
somebody else's display.
-geometry <geometry>
where to place the x11lock window. This is of the
form [<width>x<height>][{+-}<x>{+-}<y>]. The width
and height specifications are ignored.
-title <title> changes the name of the x11lock window.
-name <name> name to use instead of x11lock when determining
.Xdefaults resource values. This also affects the
name of the window (unless -title is also used).
-iconic start in the icon state.
-synchronous run the program in synchronous mode. This causes
each X call to wait around for completion and slows
down the program. It is mainly a debugging tool.
-borderwidth <width>
width of border (in pixels). Some window managers
ignore this.
-bw <width> shorthand for -borderwidth.
-bordercolor <color>
color of border.
-bc <color> shorthand for -bordercolor.
-xrm <option> allows you to enter a .Xdefaults resource line from
the command line. For example, you could enter -xrm
'x11lock*lock.label: OUT TO LUNCH'.
-background <color> background color used for everything.
Note: this will cause the locked, unlocked, cursor,
and covered backgrounds to be the same color. It is
better to set the separate background colors through
your .Xdefaults file.
-bg <color> shorthand for -background.
-foreground <color> foreground color used for everything.
Note: this will cause the locked, unlocked, cursor,
and covered foregrounds to be the same color. It is
better to set the separate foreground colors through
your .Xdefaults file.
-fg <color> shorthand for -foreground.
-font <font> font used for everything.
Note: this will cause the pushbutton and status fonts
to be the same. It is better to set the separate
fonts through your .Xdefaults file.
-fn <font> shorthand for -font.
x11lock also supports the following application-specific command line
options:
-locked starts the program in the locked state. By default,
this is the covered state, but you can manipulate
this in your .Xdefaults file using the covered
resource.
-window <window name>
uses the specified window to cover the display
instead of a blank window. This is the window name
you would see if you execute an xwininfo -root -tree
command. The window must already exist.
-program <program name>
uses a window from the named program to cover the
display instead of a blank window. If the program
has a different name than the window, you may use
both the -program and -window options.
The algorithm used when coming up with a covering
window is as follows. First, x11lock sees if a
window of the specified name (or with the same name
as the specified program) exists. If so, it uses
that window. Otherwise, it checks if the program is
running. If so, it sends it a SIGUSR1 (this causes
programs such as x11fish to create a window, and
causes other programs to die a miserable death).
Finally, it attempts to start the named program, and
repeats the above sequence. If all else fails, a
blank covering window is used.
-keys <keyholders> a list of all users whose passwords are allowed to
unlock the display, in addition to the two default
passwords described above. User names may be
separated by commas, spaces, or tabs. If spaces or
tabs are used, be sure to quote the entire string of
users (e.g., -keys 'larry moe curly').
-timeout <seconds> how often the covering window is raised during the
locked-and-covered state. A timeout of zero or less
will disable this feature.
X RESOURCES
The following resources can be defined in your .Xdefaults file to
customize x11lock the way you want it. Other combinations are possible,
using classes, wild cards, and such. For more details, see the X
documentation. System defaults are stored in the file /usr/X11/lib/app-
defaults/XLock.
Generic Resources
x11lock*locked Program starts in the locked state.
x11lock*covered If this is true (default), using the -locked option
or the locked resource results in a covered screen.
If this is false, the program will run in the locked
but visible mode.
x11lock*program Program to use when covering display.
x11lock*window Window to use when covering display.
x11lock*keys List of usernames allowed to unlock the display.
x11lock*timeout How often the covering window is raised, in seconds.
x11lock*borderWidth Width of the border around the x11lock window, in
pixels.
x11lock*borderColor Color of the border around the x11lock window.
Locked and Unlocked Resources
The following can be independently set for the unlocked state and the
locked state. Substitute either unlocked or locked for <state>.
x11lock*<state>.foreground
Color of the pushbutton text and the padlock picture.
x11lock*<state>.background
Color of almost everything else.
x11lock*<state>.topShadowColor
Color of the top and left sides of the pushbuttons.
x11lock*<state>.bottomShadowColor
Color of the bottom and right sides of the
pushbuttons.
x11lock*<state>.topShadowTile
Tile used on the top and left sides of the
pushbuttons.
x11lock*<state>.bottomShadowTile
Tile used on the bottom and right sides of the
pushbuttons.
Cursor Resources
x11lock*cursor.foreground
Color of the keyhole and outline of the padlock
cursor.
x11lock*cursor.background
Color of everything else on the padlock cursor.
Covering Window Resources
x11lock*covered.foreground
Color of the status message text on the covering
window.
x11lock*covered.background
Color behind the text on the covering window.
x11lock*covered.hSpace
Space to the right and left of the status message
text, in pixels.
x11lock*covered.vSpace
Space above and below the status message text, in
pixels.
x11lock*covered.lineSpace
Space between lines of the status message text, in
percent of line height.
x11lock*covered.font
Font used for status message text.
Button Resources
Substitute lock or cover for <button>.
x11lock*<button>.width
Width of the pushbutton, in pixels.
x11lock*<button>.height
Height of the pushbutton, in pixels.
x11lock*<button>.sensitive
Whether the pushbutton works or not.
x11lock*<button>.sensitiveTile
How to modify the way the label looks if the
pushbutton is not sensitive.
x11lock*<button>.font
Font to use for the pushbutton label.
x11lock*<button>.label
Label to use on the pushbutton.
x11lock*<button>.labelLocation
Position of the label on the pushbutton (left, right,
or center).
x11lock*<button>.hSpace
Space to the right and left of the pushbutton label,
in pixels.
x11lock*<button>.vSpace
Space above and below the pushbutton label, in
pixels.
FILES
/usr/X11/lib/app-defaults/XLock
${HOME}/.Xdefaults
BUGS
If a program specified by the -program option needs a geometry
specification to be automatically placed by the window manager, you must
include it in the program line (e.g., -program 'xload -geometry +0+0').
The lock state steals the cursor before you have an opportunity to place
the window, and the result is a display that thinks it's covered but
isn't.
We couldn't figure out how to tell twm to leave the size of the window
alone, so twm gets upset if you try to resize it.