You are not logged in.

#1 2011-07-31 20:35:06

ldb88
Member
Registered: 2010-06-20
Posts: 6

s2ram + lock

I've been trying to get my Macbook Pro to suspend and lock when I close the lid.  This is the relevant part of my /etc/acpi/handler.sh:

button/lid)
        case `grep -c closed /proc/acpi/button/lid/LID0/state` in
            0) # opening lid
                ;;
            1) # closing lid
                # TODO: run vlock as user on current tty?
                /usr/bin/vlock -na
                s2ram
                ;;
         esac
        ;;

I've tried a few variations.  I think vlock must come before s2ram (not when opening the lid).  Otherwise once you resume you see the screen (and can even type commands) for a bit before the lock applies.  But with vlock first, as above, the laptop suspends, but never locks.  I've tried "/usr/bin/vlock -na &" and also sleeping between the two.

I need something that works without X, which is why I am using vlock and not xlock, etc.

Any idea how to do this?

Offline

Board footer

Powered by FluxBB