In old versions of gnome the command gnome-screensaver-command -l would lock your screen.

As gnome-screensaver is no more in gnome 3.8 you now have to send a dbus call. I think this is then handled by GDM.

dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock

It works on my LXDE in Lubuntu 18.04.

I read https://unix.stackexchange.com/a/107789/674, but still wonder what the command is doing?

What screen-locking program does dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock invoke?

Is this way of locking dependent on Gnome? I am not using Gnome but LXDE.

Is there some way to unlock a screen locked in this way (and from another machine via ssh)?


Your Answer

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

Browse other questions tagged or ask your own question.