Lock the x terminal / display.

Posted on 2004-04-21
Last Modified: 2010-04-21
Hi - I am trying to understand how we can lock the x terminal / display on RedHat?
 Are there some API's that we can use for this purpose ?

Basically lock the x display just like Xlock does but I would like to implement my own and not use xlock.

Question by:menong120699
LVL 12

Accepted Solution

stefan73 earned 50 total points
ID: 10886291
Hi menong,
Check the source code of xlockmore at

You'll find the source for locking in xlock.c


Assisted Solution

Alf666 earned 50 total points
ID: 10892025
Basically, "locking" just means grabbing the keyboard and mouse events. You can use :


use man :

man XGrabKeyboard
man XGrabPointer


Author Comment

ID: 10901277
How can I make use of ? I want to launch my own Java login GUI instead of the standard login and password gui that xlock provides.

Also, which file does xlock use to implement the login/passwd GUI ?


Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Shell script / command to generate IO / IOPS load 22 365
linux / python expert needed 3 93
Understanding Futures with busy waiting 2 88
Openwrt vnstat 9 186
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question