7

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?

lofidevops
  • 3,159

1 Answers1

10

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?"

lofidevops
  • 3,159
  • Didn't work for me on Mint 21. Even running just gnome-screensaver from the terminal didn't work. Odd. – Nav May 24 '23 at 06:26