I'm running a GNOME/Wayland desktop environment, with GDM, on a Debian-based distro. I normally lock the screen with Super + L .

Is there a command to invoke the screen-lock from the terminal?

marked as duplicate by don_crissti, david.libremone, glenn jackman, slm Apr 12 '18 at 21:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Yes you can do this.

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

From http://choffee.co.uk/thoughtsplurge/posts/2013/07/11/lock_gnome_screensaver/ via "How can I lock my screen in Gnome 3.8 without GDM?"

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