How to Disable The Gnome Desktop Screen Lock

How to disable entirely the GNOME lock screen?

The only way I found is to use a Gnome extension called Disable Screen Shield.

How do I disable the GNOME desktop screen lock?

The screen saver can also lock the screen. Uncheck either 'Activate screensaver when computer is idle' or 'Lock screen when screensaver is active' or both in screensaver preferences. From commandline use gnome-screensaver-preferences or goto 'System->Preferences->Screensaver'.

I think the corresponding keys (for use with gconftool-2) are /apps/gnome-screensaver/idle_activation_enabled and /apps/gnome-screensaver/lock_enabled.

HTH

Ubuntu: Do NOT lock the screen when pressing Super+L

Unity also has a shortcut to lock the screen, so you need to disable that one too.

disable shortcut screenshot

  • Install and run CompizConfig Settings Manager
  • Click "Ubuntu Unity Plugin"
  • Click the button next to "Key to lock the screen."
  • Disable

Ubuntu, lock screen but do not screensave

As described in this thread on ubuntu forums it looks like this is part of the gnome-screensaver-command and there is no easy way to disable it. Try replacing the default screensaver with another one, like xscreensaver.

Hint: when you manually lock your screen, just hold the buttons a second longer and the screen won't turn off.

Inhibit screensaver with Python

I have been looking into this a while ago and finally ended up using xdg-screensaver which I call via subprocess.

import subprocess

def suspend_screensaver():
window_id = subprocess.Popen('xwininfo -root | grep xwininfo | cut -d" " -f4', stdout=subprocess.PIPE, shell=True).stdout.read().strip()

#run xdg-screensaver on root window
subprocess.call(['xdg-screensaver', 'suspend', window_id])

def resume_screensaver(window_id):
subprocess.Popen('xdg-screensaver resume ' + window_id, shell=True)

This is not ideal but apparently there is no other solution that would not involve messing around with DE-specific stuff like dbus or gnome-screensaver-command.

I don't really like the call to xwininfo and wish there was a cleaner way but so far could not find anything better. Another issue with the xwininfo approach is that it uses the id of the root window instead of the app window. Using the app window id instead of the root window would remove the need for the resume_screensaver method since it would then resume as soon as the window is destroyed.

And if you want to simulate keystrokes here is a naive bash script I have been using for some time. It does require xdotool which has to be installed separately.

#!/bin/bash
while :
do
sleep 200
nice -n 1 xdotool key shift
echo .
done

UPDATE

After having used the python solution above for over a year, it was found to occasionally create zombie processes and/or too many instances of xdg-screensaver, so after digging around, I found a simpler alternative which is Gnome-specific, but works for me even in a non-Gnome DE (XFCE) since the core Gnome libraries are required by many GTK-based apps even if you don't have a Gnome desktop.

import subprocess

def suspend_screensaver():
'suspend linux screensaver'
proc = subprocess.Popen('gsettings set org.gnome.desktop.screensaver idle-activation-enabled false', shell=True)
proc.wait()

def resume_screensaver():
'resume linux screensaver'
proc = subprocess.Popen('gsettings set org.gnome.desktop.screensaver idle-activation-enabled true', shell=True)
proc.wait()

how can I re-disable the hot corner in gnome-shell 40?

It appears I had to reboot for the gsettings command to take effect. And now that I did reboot, the command is taking effect immediately, meaning I can switch live the hotcorner feature with

gsettings set org.gnome.desktop.interface enable-hot-corners false

and

gsettings set org.gnome.desktop.interface enable-hot-corners true

I suppose that it did not work because the workstation was not rebooted since I had upgraded GNOME. Hope this documents this feature's behaviour as a whole.



Related Topics



Leave a reply



Submit