You are not logged in.

#1 2009-09-28 22:41:47

wombat.mate
Member
Registered: 2009-09-11
Posts: 5

hibernate & asking for password

hello fellow archers!

i'd like to know if there's a way to do what i want to do, although it does sound a little silly even to me. the point is that i've configured my laptop for suspension & hibernation with pm-utils and i have added a hook for xlock to have it locked when waking up. although i still find this method quite unelegant (my applications appear for a second before xlock kicks in -- suggestions welcome smile), it does work. the problem is that - for how careful and sneaky i might be - my quite linux-unsavvy brothers and relatives might get their hands on my pc while hibernated and try using it. they would of course be unable to unlock the pc and therefore resort to powering it off, with presumably sad consequences.

i'd like to find a substitute for xlock with a "logout" option in case somebody doesn't know the password for the current user. in this way they'd be able to just logout and log back in with their guest user. do you think there's any hope at all of finding something similar?

thank you very much!
leo

Offline

#2 2009-10-04 18:52:39

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 111
Website

Re: hibernate & asking for password

You should lock the screen before suspending/hibernating (do it in background). Use your WM lock command in order to have the option to change user, for instance.

I use the following script to suspend or hibernate (as root):

#!/bin/bash

# Use the line below for gnome
su your_username -c  "DISPLAY=:0 gnome-screensaver-command --lock &";
# KDE:
#su your_username -c "DISPLAY=:0 /usr/lib/kde4/libexec/krunner_lock --forcelock &"
# If you don't use gnome/kde, you might be interested in slock
# (type your password and press enter in the black screen to unlock)
#su your_username -c "DISPLAY=:0 slock &"

# You can replace the following lines with a call to pm-utils. If you have
# proper permissions, it won't be necessary to call this script as root

# Suspend:
echo platform > /sys/power/disk
echo mem > /sys/power/state

# To hibernate, use these lines instead.
# If you drop caches, less memory will have to be copied between RAM to disk,
# so it will hibernate and resume faster.
echo 3 > /proc/sys/vm/drop_caches
echo platform > /sys/power/disk;
echo disk > /sys/power/state;

Offline

Board footer

Powered by FluxBB