Ubuntu – Lock screen command Ubuntu 17.10

17.10command linegnomelock-screen

What is the lock screen command in Ubuntu 17.10?

I want to shortcut the command since I don't have any dedicated special key for this on my Lenovo T470s. If I press the super (Windows) key and search for 'lock screen' I get a button to click on that does the job but I can't figure out the terminal command from there.

Best Answer

You can lock screen using the default Super+L key combination (Super is usually the Windows key).

You can also lock using the following commands

gnome-screensaver-command --lock

(needs gnome-screensaver package installed)

or

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

(needs GDM).