How to Lock Your Machine and Display Application Screen
We have a couple monitoring applications running on our Linux desktop. To monitor server health, graph utilization through various network monitoring systems. Usually monitoring application required authentication and it will be a security issue if you left your Linux desktop unlock.
But if you lock your Linux desktop, the screen will goes blank and you can’t monitor what is projected on your screen. There is a way to do it with screen saver lock, where you can lock your Linux desktop and at the same time to display when application is running on your monitoring screen.
Lock Your Machine with xlock
First, install xlock in your Linux desktop
shell> sudo apt-get install xlock
After xlock has been install, create a file name lockscreen, chmod to 777 and paste the line below in the file
# /usr/bin/xlock -mode image -geometry 0x0 -timeout 1
shell> vi lockscreen
shell> chmod 755 lockscreen
xlock is screen saver lock, but it can disable the screen saver screen by setting display with “-geometry 0x0”.
You can also bind your keyboard short cut key to launch the lockscreen script through System > Preferences > Keyboard Shortcuts.
Thanks for the tip; I had exactly this problem and it helped me out a lot. I did have to make a small modification for my Linux Mint 13 machine to keep it from blanking the screen after a minute or so; here’s the command I used:
/usr/sbin/xlock -enablesaver -resetsaver -mode blank -geometry 0x0 -timeout 1
Pretty much the same thing, except to add flags to disable the screen saver and disable screen saver reset, and to change the mode from “image” to “blank”.