FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Posts
    1,234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Solution for double resume problem on ThinkPad when using hotkeys

    After some reading and experimenting, I found the solution to stop Suspend to RAM and Suspend to Disk (Hibernation) from needing to be resumed twice (or thrice) when invoked with the ThinkPad hotkeys Fn+F4 (suspend to ram) and Fn+F12 (hibernate)

    On my T42 I had to edit the file /home/<user>/.Xmodmap to include the lines:

    Code:
    keycode 150 =
    keycode 213 =
    You need to log-out / log-in for the changes to take effect.

    If you do not have that file, you can create it as root using gedit. In Nautilus you need to have View > Show Hidden Files checked to see this file in your home directory.

    I found which keys to add to .Xmodmap by running the command: xmodmap -pke
    Search for the lines that have XF86Sleep (suspend to ram) or XF86Suspend (hibernate to disk) in them to get the keycodes.

    Apparently this can be set with xbindkeys, but since I got it to work with .Xmodmap, I am not going to explore this option.
    http://bbs.archlinux.org/viewtopic.php?id=74806

    Now if I can just figure out how to turn off the display backlight using Fn+F3 and radeontool - I will be all set.
    Fedora 19 Gnome on a ThinkPad X220, i5-2540M CPU, Intel HD Graphics 3000, Intel N 6205 wireless, and Sierra Wireless 754S Mobile Hotspot (AT&T)

  2. #2
    Join Date
    Jul 2009
    Posts
    1,234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by David Batson
    Now if I can just figure out how to turn off the display backlight using Fn+F3 and radeontool - I will be all set.
    Well, I finally cracked this nut.

    I created the following file as root: /etc/acpi/events/blank
    Code:
    event=ibm/hotkey HKEY 00000080 00001001
    action=/etc/acpi/actions/blank.sh
    I additionally created the this file as root: /etc/acpi/actions/blank.sh
    [Note that radeontool needs to be installed.]
    Code:
    #!/bin/bash 
    
    RADEONTOOL='/usr/sbin/radeontool' 
    
    STATUS=`$RADEONTOOL light|awk '/The radeon backlight looks / {print $5}'`; 
    
    if [ $STATUS == "on" ] ; then 
            $RADEONTOOL light off 
    elif [ $STATUS == "off" ] ; then 
            $RADEONTOOL light on 
    fi
    Next I ran the command as root: chmod +x /etc/acpi/actions/blank.sh
    Then I ran the command as root: chmod u+s /usr/sbin/radeontool
    Finally, I found I needed to run this command as root for the hokey sequence to work: /etc/rc.d/init.d/acpid restart

    Now the hotkey combo Fn+F1 will turn off (and back on) the display backlight. Normally the hotkey combo Fn+F3 is used for this, but since Fedora invokes the screensaver and lock with Fn+F3, I decided to use the unused Fn+F1 combo. FYI, you can find out what keys are used for what in the file: /usr/share/hal/fdi/information/10freedesktop/30-keymap-module-thinkpad-acpi.fdi

    FWIW: A different option than using radeontool would be to use DPMS. See following for more info.
    http://www.thinkwiki.org/wiki/How_to..._.28Standby.29
    One difference I notice using DPMS is that the display backlight is turned back on by moving the mouse (TrackPoint). When using radeontool, the hotkey sequence Fn+F3 is needed to turn the display backlight back on (or off).

    I also discovered an optional way for using a hotkey such as the "Access IBM" or "ThinkVantage" button to accomplish the same thing. Go to System > Preferences > Keyboard Shortcuts. Click on Add then for "Name" type a description such as Blank Screen in the top box, and for "Command" a command such as /etc/acpi/actions/blank.sh in the bottom box and click on Apply. Next click on the right side for the Shortcut and press the applicable hotkey such as "Access IBM". It should now work.

    FWIW, I notice the followiing webpage says radeontool should no longer be used, and instead "Backlight can be modified through sysfs". Great! But I have no idea how, and did not run across the necessary information in my searches on how to modify sysfs. Anyway, radeontool works fine for me. Radeontool is in Fedora 11's repos.
    http://www.thinkwiki.org/wiki/Radeontool
    Fedora 19 Gnome on a ThinkPad X220, i5-2540M CPU, Intel HD Graphics 3000, Intel N 6205 wireless, and Sierra Wireless 754S Mobile Hotspot (AT&T)

  3. #3
    Join Date
    Mar 2006
    Posts
    2,207
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the solutions.
    jbkt23
    Thinkpads Depends on era T23 - X2xx
    AMD & Intel Boxes

Similar Threads

  1. Suspend/resume issue FC6 + Thinkpad
    By icantux in forum Hardware
    Replies: 11
    Last Post: 24th February 2007, 01:19 AM
  2. Resume faulty on Thinkpad T21
    By timefortea in forum Hardware
    Replies: 0
    Last Post: 18th November 2006, 10:26 AM
  3. Replies: 5
    Last Post: 30th August 2006, 05:56 PM
  4. FC4 occasionally hangs on resume, Thinkpad 600E
    By nlippincott in forum Hardware
    Replies: 1
    Last Post: 31st July 2005, 01:41 PM

Tags for this Thread

Posting Permissions

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