Re: Automatic console locking at system suspend
You could use tmux, run $ sleep 5; zzz; then detach from tmux and ^D to logout before system suspends. On Wed, May 7, 2014 at 8:44 PM, Alessandro DE LAURENZIS just22@gmail.com wrote: Hi Tristan, No, I'm trying to lock the wscons, not an X session... Cheers On 7 May 2014 22:42:35 CEST, Tristan PILAT tristan.pi...@gmail.com wrote: On Mon, Apr 21, 2014 at 4:51 PM, Alessandro DE LAURENZIS just22@gmail.com wrote: Hello, I google-ed a lot, but it seems that there is no trivial solution to this point. I extensively use console (and tmux), ending up with a lot of simultaneously open shells; I normally suspend my laptop when I leave, so it would be a security enhancement to automatically lock all of them. I advice you to install slock and autolock and then add something like for example exec xautolock -time 10 -locker 'slock' to your .xinirc or .xsession -- Tristan -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Re: Automatic console locking at system suspend
On Mon, Apr 21, 2014 at 4:51 PM, Alessandro DE LAURENZIS just22@gmail.com wrote: Hello, I google-ed a lot, but it seems that there is no trivial solution to this point. I extensively use console (and tmux), ending up with a lot of simultaneously open shells; I normally suspend my laptop when I leave, so it would be a security enhancement to automatically lock all of them. I advice you to install slock and autolock and then add something like for example exec xautolock -time 10 -locker 'slock' to your .xinirc or .xsession -- Tristan
Re: Automatic console locking at system suspend
Hi Tristan, No, I'm trying to lock the wscons, not an X session... Cheers On 7 May 2014 22:42:35 CEST, Tristan PILAT tristan.pi...@gmail.com wrote: On Mon, Apr 21, 2014 at 4:51 PM, Alessandro DE LAURENZIS just22@gmail.com wrote: Hello, I google-ed a lot, but it seems that there is no trivial solution to this point. I extensively use console (and tmux), ending up with a lot of simultaneously open shells; I normally suspend my laptop when I leave, so it would be a security enhancement to automatically lock all of them. I advice you to install slock and autolock and then add something like for example exec xautolock -time 10 -locker 'slock' to your .xinirc or .xsession -- Tristan -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Automatic console locking at system suspend
Hello, I google-ed a lot, but it seems that there is no trivial solution to this point. I extensively use console (and tmux), ending up with a lot of simultaneously open shells; I normally suspend my laptop when I leave, so it would be a security enhancement to automatically lock all of them. Trying to follow the same approach I use to lauch xlock for the X session, I run the following script from my .kshrc: just22@poseidon:[~] cat ./bin/console-lock #!/bin/sh # Lock console when SIGUSR1 is received trap '/usr/bin/lock -np' USR1 # Daemonize... while /usr/bin/true; do sleep 1 done just22@poseidon:[~] egrep -A1 -B3 console-lock /home/just22/.kshrc # In console, activate colour support and auto-lock if [ ${TERM} == vt220 ]; then export TERM=wsvt25 ${HOME}/bin/console-lock fi Now, when I send a USR1 signal to all the open console-lock processes (manually or by means of /etc/apm/suspend): just22@poseidon:[~] pkill -USR1 -f .*console-lock the lock command is correctly spawn in each console, but since the parent process is in background, it is in background, too (resulting useless, of course). How could I improve the idea? Of course, any suitable alternatives would be welcome. Thanks in advance -- Alessandro DE LAURENZIS [mailto:just22@gmail.com] LinkedIn: http://it.linkedin.com/in/delaurenzis
Re: Automatic console locking at system suspend
On Mon, Apr 21, 2014 at 16:51, Alessandro DE LAURENZIS wrote: Hello, I google-ed a lot, but it seems that there is no trivial solution to this point. I extensively use console (and tmux), ending up with a lot of simultaneously open shells; I normally suspend my laptop when I leave, so it would be a security enhancement to automatically lock all of them. Trying to follow the same approach I use to lauch xlock for the X session, I run the following script from my .kshrc: I think you have to use X.
Re: Automatic console locking at system suspend
Hello Try slock -- http://tools.suckless.org/slock/ 2014-04-22 1:51 GMT+11:00 Alessandro DE LAURENZIS just22@gmail.com: ... Of course, any suitable alternatives would be welcome. -- //Alex
Re: Automatic console locking at system suspend
On Mon, Apr 21, 2014 at 4:51 PM, Alessandro DE LAURENZIS just22@gmail.com wrote: Hello, I google-ed a lot, but it seems that there is no trivial solution to this point. I extensively use console (and tmux), ending up with a lot of simultaneously open shells; I normally suspend my laptop when I leave, so it would be a security enhancement to automatically lock all of them. How about using lock(1) ? Trying to follow the same approach I use to lauch xlock for the X session, I run the following script from my .kshrc: just22@poseidon:[~] cat ./bin/console-lock #!/bin/sh # Lock console when SIGUSR1 is received trap '/usr/bin/lock -np' USR1 # Daemonize... while /usr/bin/true; do sleep 1 done just22@poseidon:[~] egrep -A1 -B3 console-lock /home/just22/.kshrc # In console, activate colour support and auto-lock if [ ${TERM} == vt220 ]; then export TERM=wsvt25 ${HOME}/bin/console-lock fi Now, when I send a USR1 signal to all the open console-lock processes (manually or by means of /etc/apm/suspend): just22@poseidon:[~] pkill -USR1 -f .*console-lock the lock command is correctly spawn in each console, but since the parent process is in background, it is in background, too (resulting useless, of course). How could I improve the idea? Of course, any suitable alternatives would be welcome. Thanks in advance -- Alessandro DE LAURENZIS [mailto:just22@gmail.com] LinkedIn: http://it.linkedin.com/in/delaurenzis