Using s2ram (suspend) with Klaptop in KDE 3.5

I was not completely happy with the suspend function offered by Klaptop in KDE 3.5, so I decided to use s2ram from the suspend package (http://suspend.sourceforge.net/) instead.

I’m assuming here that you are using Klaptop to suspend your machine, that the suspend package is installed and working (so that typing e.g.

s2ram -f -p

 

from an X terminal suspends your machine), but that you’d like Klaptop to use s2ram instead of it’s own program.

  1. Become root:
    su -
  2. Look at the entry ‘Fixes’ after typing
    s2ram -n

    and determine which workarounds you should use (with --force) on your machine

  3. Test to see whether you have the right options by invoking
    s2ram

    from an X-terminal (in my case

    s2ram -f -p --force --vbe_save

    for my MacBook,

    s2ram -f -p -m

    for my ThinkPad)

  4. Write a small script that executes s2ram with the desired options:
    /usr/local/sbin/s2ram_local:

    #!/bin/bash
    # Call s2ram with the options needed for this machine
    
    s2ram -f -p -m
    
  5. Set the setuid bit for your script and the original s2ram binary:
    chmod +s /usr/local/sbin/s2ram_local `which s2ram`
  6. Locate the Klaptop ACPI-helper program:
    locate klaptop_acpi_helper

    . On my Gentoo distribution, it’s in

    /usr/kde/x.x/bin/klaptop_acpi_helper
  7. Back it up:
    mv -i /path/klaptop_acpi_helper /path/klaptop_acpi_helper.bak
  8. Replace it with a symbolic link to your script:
    ln -s /usr/local/sbin/s2ram_local /path/klaptop_acpi_helper

Links:

Advertisements
This entry was posted in All, Software and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s