Take the 2-minute tour ×

I would like my computer to logout every time I close the lid. And by that I mean log out completely. Basically I want the startup applications to run every time I open the lid to my computer. Right now, it just locks the screen and comes right back when I type in my password. It would be really great if I can have it such that the startup applications run every time I open the lid. However, would logging out lose any unsaved files?

Alternatively, do you know if there is a way to run a command every time I open the lid?

This is a Dell Inspiron E1505 running Ubuntu 10.04.

share|improve this question
add comment

1 Answer

Assuming that you're running some version of Ubuntu (you should have included this information), on some laptop (you should have included this information), I'll try to help. YMMV

If you read man acpid, and snoop further, you'll find that /etc/acpi/events/lidbtn tells the "Advanced Configuration and Power Interface event Daemon" to execute/etc/acpi/lid.sh.

/etc/acpi/lid.sh checks for the existence of an executable file called /etc/acpi/local/lid.sh.pre before it does its work, and /etc/acpi/local/lid.sh.post after its work, and (in both cases) executes the file.

You'll have to begin by creating the directory /etc/acpi/local, then commands in whichever file seems best.

share|improve this answer
add comment

Your Answer


