Ubuntu – run command automatically right after wake up from standby (“sleep”)

kdekubuntustandby

How can I run a command automatically every time my systems wakes up from standby ("sleep")? I am using Kubuntu. (still 9.10 but I'll migrate soon to 10.4)

As the window manger is locked right after wake up it would suffice if the command is executed every time after unlocking the screen.

Best Answer

Using ACPI, you can configure scripts to run as certain events are triggered by the laptop. I used to run a script to reload errant network drivers after a restored from sleep. No idea if you have ACPI on your machine, or if you are using acpid, but thought I'd throw the suggestion out there.

Triggering off of a screen unlock is an entirely different thing and ACPI wouldn't apply there.

Related Question