Linux command
xlock 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Lock screen immediately
xlock
Lock with specific mode
xlock -mode [blank]
Lock with message
xlock -message "[Away from desk]"
Lock without password (demo mode)
xlock -nolock
Lock with specific timeout
xlock -timeout [30]
List available modes
xlock -help
说明
xlock locks the X display until the user enters their password. While locked, the screen displays a configurable animation or pattern, and new X server connections are refused. Multiple display modes provide visual effects during lock. The blank mode simply blacks out the screen, while others show animations like life simulation, mazes, or geometric patterns. The tool blanks the screen, hides the mouse cursor, and requires the user's system password to unlock. All keyboard and mouse input is captured until authentication succeeds.
参数
- -mode _name_
- Display mode (blank, life, maze, etc.).
- -message _text_
- Message to display on lock screen.
- -nolock
- Demo mode; no password required.
- -timeout _seconds_
- Password timeout in seconds.
- -echokeys
- Echo characters when typing password.
- -usefirst
- Use first character of password prompt.
- -allowaccess
- Allow X clients while locked.
- -remote
- Allow remote locking.
FAQ
What is the xlock command used for?
xlock locks the X display until the user enters their password. While locked, the screen displays a configurable animation or pattern, and new X server connections are refused. Multiple display modes provide visual effects during lock. The blank mode simply blacks out the screen, while others show animations like life simulation, mazes, or geometric patterns. The tool blanks the screen, hides the mouse cursor, and requires the user's system password to unlock. All keyboard and mouse input is captured until authentication succeeds.
How do I run a basic xlock example?
Run `xlock` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -mode _name_ do in xlock?
Display mode (blank, life, maze, etc.).