Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to lock and suspend from the terminal. I tried:

pmi action suspend | at now + 1 min

And then typed

exit

But both that and vlock kill the running command. Is there a way to lock the terminal and than get the computer to suspend using only Terminal commands?

share|improve this question
    
askubuntu.com/questions/184728/… –  AgentCool Feb 11 '13 at 15:03
1  
This command only seems to work in a terminal running side the GUI. When I try and run it from a virtual terminal it dosn't work also it does not lock the virtual terminal itself. –  Spiitfire Feb 11 '13 at 18:43
    
Have you tried pm-suspend from the pm-utils package? –  Attila O. Feb 12 '13 at 2:09
add comment

1 Answer 1

up vote 0 down vote accepted

I use sudo -v;gnome-screensaver-command --lock;sleep 10;sudo pm-suspend, with the sleep long enough for me to put the kbd and mouse away. Look at man pm-action for other commands (pm-hibernate,pm-suspend-hybrid), and be aware that hibernate doesn't work with encrypted swap.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.