Update! There is a way to use the normal lock screen! Yay!
I don't know how secure it is (storing your password in plaintext), but I think it is the best possible.
This is the lock command:
There are 2 unlock commands:
This is the 1st unlock command:
gnome-screensaver -d && xdotool type mypassword12 && xdotool key Return
The click is to wake it up (it should click inside the login box, because of the mouse move), and show the nice new lock screen, instead of the "sleeping" black screen.
Then it types
mypassword123! with an enter, to submit it, into the text box.
Important. For some reason - probably because of what xdotool is actually meant to be used for (keyboard shortcuts) - you can't enter double letters. To get around this, split it into 2 commands at each double letter (as above). Also, numbers have to have their own, separate command from letters (also above). Finally, modifiers (such as shift) need a separate one, as does the Return key.
This is the second one. It is a bit better and less hackish, but requires a lot of setting up.
First install actionaz:
sudo apt-get install actionaz
Open a new script, and drag in the correct items to your flow. (you can download the completed one here. If you chose to download this, open it, double click on Write text - Password here, and enter your password).
- Pause: enter 3 seconds.
- Click: copy and paste
165:555 into the Position box. (Depending on screen side, this may be different. Make sure it is clicking in the password box, otherwise it doesn't work).
- Write text: enter your password in the box
- Key: Click in the box and press Return
Save it in your home folder as unlock.ascr (or any name - I just didn't want to advertise that it had my password in it)
Set up your proximity command to be:
xdotool mousemove 0 0 && actionaz unlock.ascr -ex
The mouse move wakes it up, and the options tell it to execute the script and then exit at the end.
If you lose your device, you can always just type your password, so it is reversible.