It is basically the same question as in this, but using gnome-screensaver-command -l
locks the screen to GNOME3 styled login screen, not Ubuntu lock screen.
On this renewed question for 14.04, the answer is to use:
dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
But the result is the same, the lock screen is still the GNOME3 one.
What is the command that works from outside of Unity?
Apparently, the above two answer works, but only when I'm in Unity. In xmonad they always locks to GNOME lock screen. I've changed the title accordingly.
PS: I need this to setup a keyboard shortcut in xmonad, so I can't use xdotool.
loginctl --help
– xR34P3Rx Sep 26 '17 at 16:21