Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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/

/etc/acpi/ checks for the existence of an executable file called /etc/acpi/local/ before it does its work, and /etc/acpi/local/ 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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.