acpi workaround for broken display reset after lid close in fedora 12

Yesterday I started to migrrate my notebook to Fedora 12. First it was all fun, but then the bugs hit me. A currently very annoying commonly known bug is, that on intel notebooks, the display may not get switched on, if the lid was closed. The current workaround is to create a shortcut to call xrandr to reset the output. I wanted this to happen automatically and after I failed to even get a gasp about how to do this with hal. Is there even any documentation or guide that explains this for anyone like “man acpid” explains how to perform actions when the lid is opened/closed? I was first foolished by acpid not wanting to start because hal-addon-acpi already opened /proc/acpi/events, but thanks to the bug report I knew that it is just an problem of the startup order. Hal was already started, but after I stoppped it, I could easily start acpid and then haldaemon again.

Now here is the configuration to get the he workaround xrandr calls run automatically:

cat /etc/acpi/actions/reset-display.sh
#!/bin/bash
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
export DISPLAY=:0.0
if grep open /proc/acpi/button/lid/LID/state
then
su "$(getent passwd 500 | cut -d: -f1)" -c "xrandr --output LVDS1 --off"
su "$(getent passwd 500 | cut -d: -f1)" -c "xrandr --output LVDS1 --auto"
fi


cat /etc/acpi/events/reset-display.conf
event=button/lid LID 00000080.*
action=/etc/acpi/actions/reset-display.sh

It will only work if the user with uid 500 uses display :0.0. Probably this could be changed to work in all cases, but it works for me. :-)

Tags: , , ,

2 Responses to “acpi workaround for broken display reset after lid close in fedora 12”

  1. Paul W. Frields Says:

    Do the hooks in /etc/pm/sleep.d/* not work for you? Directions for using them are in /usr/share/doc/pm-utils/HOWTO.hooks but this is a serious question. I was under the impression that these hooks were the generally accepted practice for putting in hacks, but I could be wrong.

  2. till Says:

    The sleep.d hooks are only used for suspend/hibernate and resume/thaw, but here on lid close only the display is switched off and the gnome-screensaver locks the display, which is all I what.

Leave a Reply