Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This
Like this article? We recommend KDE Power Management Setup

KDE Power Management Setup

This power manager has a range of power usage modes, from Xtreme Powersave to Performance. Under the Actions tab, I recommend selecting the following settings:

  • For Laptop Lid Closed, select "Suspend to RAM" if suspend-hybrid works. Setting this shouldn't affect what the new lid.sh does, but I don't know what else this sets up in the power management software. If it doesn't work, you probably should choose "Suspend to Disk" instead.
  • For Power Button, select "Prompt Power Dialog."
  • For Sleep Button, select "Suspend to RAM."
  • For If Off more than __ Minutes, think about how long you expect to be away from your computer. If there's a reasonable chance that you'll be gone for several hours when you use the computer, choose "Suspend to Disk." Otherwise, choose "Suspend to RAM."
  • Under the General - Advanced Battery tab: If battery power drops to critical level, and you've got hibernate working, select "Suspend to Disk." Otherwise, choose "Shutdown."

If your GUI power management doesn't support a suspend-hybrid option (if you have (K)ubuntu 9.10, it probably does), set up this simple script to run whenever the lid closes:

$ sudo cp /etc/acpi/lid.sh /etc/acpi/lid.sh-old

This command copies the default version to a backup copy, in case the replacement script breaks something.

Next, working as root in a text editor, open /etc/acpi/lid.sh:

$ sudo nano /etc/acpi/lid.sh

Replace the contents of the script with the following:

-------- copy/paste
#!/bin/bash
# TODO:  Change the above to /bin/sh

LID_CLOSED=$(cat /proc/acpi/button/lid/LID/state | grep open)
if [ "$LID_CLOSED" = "" ]; then
  /usr/sbin/pm-suspend-hybrid
fi
----------- end

Save the file and exit; then close the netbook's lid to test your changes. If the computer acts just like it did during pmi-suspend-hybrid, you're covered against power failure or battery exhaustion, and you're done. Admittedly, this is a cheap-and-dirty hack, but it should cover you until KDE 4.3 is ready. If you haven't been able to get the computer to suspend when you close the lid, this technique might fix that problem, too. (Note that this doesn't change the suspend menu option; that will simply suspend to DRAM as usual.)

Make an extra copy, just in case a distribution upgrade replaces your version of lid.sh with the original:

$ sudo cp lid.sh lid-new.sh

If your computer goes to the original suspend instead of suspend-hybrid, you can delete or rename the distribution's lid.sh with yours (until KDE 4.3 is ready, of course).

  • + Share This
  • 🔖 Save To Your Account