Unlock screen in 14.04 without `gnome-screensaver-command`

Solution 1:

This worked for me:

On the command line:

gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true

The on-screen keyboard appears when you first sign-in but you can close it.

After this gnome-screensaver-command -d works.

Taken from benshayden on https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/1307163

Solution 2:

There is no way of doing this unfortunately :(

Update - I have found a way. Check out my newer answer

This is my previous solution - It is unadvisable to use, it is not unlockable if you lose your phone; you have to restart to unlock it

I eventually came up with a solution - don't lock it in the first place. This may sound odd - bear with.

Instead of locking it, I disabled the Mouse and Keyboard, hid all desktop icons and then switched to the desktop. You could possibly hide more stuff (like the launcher) but I have that hidden anyway.

This command requires a bit of setup.

Install : xdotool - sudo apt-get install xdotool

Enter: xinput --list and note down your mouse and keyboard ids.

I would suggest editing these commands in gedit

This one acts as the locker.

xinput set-prop <Keyboard ID> 'Device Enabled' 0 && xinput set-prop <Mouse ID> 'Device Enabled' 0 && gsettings set org.gnome.desktop.background show-desktop-icons false && wmctrl -k on

This acts as the unlock.

xinput set-prop <Keyboard ID> 'Device Enabled' 1 && xinput set-prop <Mouse ID> 'Device Enabled' 1 && gsettings set org.gnome.desktop.background show-desktop-icons true && wmctrl -k off

Change the and to their respective numbers, in both commands.

In order this:

  • Disables / Enables the Keyboard
  • Disables / Enables the Mouse
  • Hides / Shows all your desktop icons
  • Toggles showing your desktop.

One important thing to bear in mind - this can't be undone without your bluetooth device. If for some reason it fails, you have to restart. Because of that, it might be advisable to leave the keyboard enabled, and set up the unlock command to a chosen shortcut.