Unlock Unity Lockscreen from Command Line
How Do I Unlock the Lock Screen in Unity from Command Line? Gnome-Screensaver-Command -L Locks the Screen, but Gnome-Screensaver-Command -D Doesn't Unlock the...
How do I unlock the lock screen in Unity from command line?
gnome-screensaver-command -l locks the screen, but gnome-screensaver-command -d doesn't unlock the lockscreen.
Is there another way to unlock the lock screen from the command line? Not via ssh, via script, for example:
gnome-screensaver-command -l && sleep 5 && <command to unlock>
1 Answer
For Ubuntu 16.04 and later:
loginctl unlock-sessions
No need for root, but needs session permission obviously.
Note:
By default gnome-screensaver-command -d doesn't work anymore in Unity but with this workaround (enable on-screen keyboard) it does. Works for both 14.04 and 16.04.