Results 1 to 4 of 4

Thread: XMonad Suspend on lid close

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Beans
    54
    Distro
    Ubuntu Studio 10.10 Maverick Meerkat

    XMonad Suspend on lid close

    In gnome or KDE it's easily configurable if not default behaviour for my laptop (lenovo x61) to suspend to ram upon the lid being closed. I'm now switching my laptop to xmonad after using and enjoying it on my desktop for quite some time now, but it doesn't suspend/resume with the lid actions anymore. Is there a way to add such a hook to xmonad such that I can get that behavior back again?

    Also, I'm using xmonad straight up, I'm not using it as the window manager for the gnome desktop environment.

    Thanks

  2. #2
    Join Date
    Nov 2005
    Beans
    54
    Distro
    Ubuntu Studio 10.10 Maverick Meerkat

    Re: XMonad Suspend on lid close

    I have come up with a solution that seems to work, though I don't know if it is really the best solution. I modified the file:

    /etc/acpi/actions/lid.sh
    Code:
    #!/bin/bash
    echo -n mem > /sys/power/state
    I removed all of the code that was included in this file by default, so who knows what I have done, but it works thus far with just the line above.

  3. #3
    Join Date
    Oct 2007
    Location
    Medicine Hat, AB, Canada
    Beans
    20

    Re: XMonad Suspend on lid close

    Quote Originally Posted by wwbdd View Post
    I have come up with a solution that seems to work, though I don't know if it is really the best solution. I modified the file:

    /etc/acpi/actions/lid.sh
    Code:
    #!/bin/bash
    echo -n mem > /sys/power/state
    I removed all of the code that was included in this file by default, so who knows what I have done, but it works thus far with just the line above.
    Thanks for your post! this got me on the right track!

    If you are running Lucid, open /etc/acpi/lid.sh and find this line

    Code:
    . /usr/share/acpi-support/screenblank
    and replace it with

    Code:
     echo -n mem > /sys/power/state
    This takes care of my power management issues on my fluxbox laptop, and doesn't add any more daemons.

  4. #4
    Join Date
    Jun 2010
    Beans
    9

    Re: XMonad Suspend on lid close

    Quote Originally Posted by hardran3 View Post
    Thanks for your post! this got me on the right track!

    If you are running Lucid, open /etc/acpi/lid.sh and find this line

    Code:
    . /usr/share/acpi-support/screenblank
    and replace it with

    Code:
     echo -n mem > /sys/power/state
    This takes care of my power management issues on my fluxbox laptop, and doesn't add any more daemons.
    Nice one - I just made a slight change so closing the lid won't put my laptop into sleep if it's charging, but will otherwise. Just replace the line you mentioned with this:

    Code:
    Dis=`acpi |cut -f3 -d" "`
    if [ "$Dis" = "Discharging," ] ; then
      echo -n mem > /sys/power/state
    else
      . /usr/share/acpi-support/screenblank
    fi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •