Is there a way to Lock a Ubuntu Desktop without blanking out the screen?

My objective is to allow everyone to view whats happening on Ubuntu Desktops, but not give anyone access to them without entering the password. The desktops are all within the workplace.

I know the simple Lock Screen will simply Lock the whole desktop screen and blank it out, But I'm looking for a similar feature that Does Not blank out the screen, but show it openly. We have some financial/transactional and News WE WANT to display (But not modify) except by the financial Admins.

I have not seen this feature in any operating system. Is there a addon/plugin out there that might Lock the screen from Keyboard/Mouse without blanking the desktop screen?

Thanks in advance..

  • wouldn't it be enough than to lock all mouse and keaboard inputs? (well than you would have to unlock over ssh for example ;) )
    – derHugo
    Jun 27, 2017 at 11:06

1 Answer 1


Use xtrlock

$ sudo apt install xtrlock

To unlock, type the password on the screen.

Automatic Lockscreen Timeout script

I wrote a quick lockscreen timeout script that will auto start the lock when the computer is idle. It works like a screen saver.

To enable it, run startup app from the Ubuntu Dash Search to add it to your autostart applications.

The script needs xprintidle to run.

$ sudo apt install xprintidle`

The Script



# The lock timoeout defaults to 15 minutes.
# Enter an argument on the commanline to for a different timeout.
# xptintidle needs to be installed for the script to work

if [[ ! $(type xprintidle 2>/dev/null) ]]; then
    notify-send "xprintidle not installed... lockscreen not enabled."
[[ "$1" ]] && idle=$1
while :; do
    if (($(xprintidle) > idle * 60000)); then
        [[ $(ps h -C xtrlock) ]] || xtrlock
    sleep 10
  • Thanks for acknowledging the answer. I added a script and instructions to auto start the lock when the screen is idle. This can be useful for the times when the operator is away and forgets to manually set the lock. Jun 27, 2017 at 13:00
  • Thanks James. I added the xtrlock to the Ubuntu panel as a shortcut to make life easy for everyone.. I bet they will like the auto lock feature as well.. Thanks again, this was really helpful.
    – Shawn
    Jun 27, 2017 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.