Running this from a tty, and this is for a display manger I couldn't use export display=.., I got this error: Not running inside a display manager, XDG_SEAT_PATH not defined. Also, don't be daft like me and run dm-tool lock in a terminal when you are logged in ;D
–
WilfJan 19 '14 at 13:45

@wilf I don't know whether he wants to do it from a tty? But with something like XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0" dm-tool lock it should work (as the error suggests). (Check your XDG_SEAT_PATH in the gui with echo $XDG_SEAT_PATH) Though this dm-tool method is kinda broken in my 12.04 as if I lock the screen with it, then switch to tty, then switch back, the screen is unlocked. :D I don't know if this is corrected in 13.10. That's why I said your method is the one and gave an up for it. (Just that method isn't related to lightdm, so maybe the OP is looking for this)
–
falconerJan 19 '14 at 13:53

dm-tool lock has no effect, but it can list Seat0 so I guess it should work.
–
RumcaJan 19 '14 at 14:09

@Rumca I looked here for a bugreport. You said openbox, so I guess you are using Lubuntu, which accordingly to that bugreport also suffers from the problem which I mentioned in my previous comment: The lock can be easily circumvented. I've just read into the conversation under that bugreport and I have the impression that you will have to install a screensaver to lock the screen. Looks like locking of the screen was never secure on Lubuntu and now the developers removed the previous lock possibility because of that.
–
falconerJan 19 '14 at 14:45

@Rumca But please read the conversation under the bugreport, I had no time to read through it.
–
falconerJan 19 '14 at 14:45