You are not logged in.

#1 2011-03-13 00:27:13

Geissler
Member
Registered: 2011-02-22
Posts: 13

lock screen + turn off monitor

So I'm currently using slock to lock the screen, and It's working perfectly: I press the hotkey, the screen blanks and doesn't come back on until I've entered my password.

Is there any way to do exactly the same thing but with the screen turning off? The command "xset dpms force off" but it comes back on at the slightest touch and I'd like it to stay off until the password is entered.

thanks!

Offline

#2 2011-03-13 02:28:13

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: lock screen + turn off monitor

Yes, I think that xset command works too fast for the system clock on the video, so it resets - you need to build in some lag time. This works for me:

sleep 1 && xset dpms force off

Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#3 2011-03-13 12:57:59

Geissler
Member
Registered: 2011-02-22
Posts: 13

Re: lock screen + turn off monitor

Yes, but there are still two problems with that:

1. Openbox can't understand the "sleep 1 &&" command if I try to execute it via a hotkey in rc.xml

2. The screen doesn't stay off until a password is entered, only until it detects user input, at which point you can only turn it back off by executing the command once more.

Offline

#4 2011-03-13 13:03:32

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: lock screen + turn off monitor

1. For openbox, use

<execute>/bin/sh -c 'sleep 1 && xset dpms force off'</execute>

Offline

#5 2011-03-13 13:23:15

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: lock screen + turn off monitor

Geissler wrote:

2. The screen doesn't stay off until a password is entered, only until it detects user input, at which point you can only turn it back off by executing the command once more.

I use a simple script for slock and dpms handling:

( slock && xset dpms 0 0 60 ) &
xset dpms 0 0 2
xset dpms force off

This essentially turns off the monitor after 2s while running slock and restores the dpms timeout setting (60s) after slock terminates.

Offline

#6 2011-03-13 22:53:34

Geissler
Member
Registered: 2011-02-22
Posts: 13

Re: lock screen + turn off monitor

jakobm, that works perfectly. Thanks a bunch!

Offline

Board footer

Powered by FluxBB