Sample Fn-F7 script

From ThinkWiki
Revision as of 17:40, 12 November 2007 by Seva (Talk | contribs)

Jump to: navigation, search

This setup will let you use fn-F7 key combination to toggle between internal, external, or both screens. Tested on ThinkPad X60s running Fedora 8.

Note: you will need to change the internal and external resolution until someone fixes this script to figure it out from xrandr, you may also need to change output names from "VGA" and "LVDS" to what your xrandr tells you.

Create /etc/acpi/events/thinkpad.conf:

# fn-F7
event=ibm/hotkey HKEY 00000080 00001007
action=/usr/local/sbin/thinkpad-fn-f7

Create /usr/local/sbin/thinkpad-fn-f7: ...

As root,

mkdir -p /var/lib/thinkpad
echo "internal" > /var/lib/thinkpad/screen.state
chmod 755 /usr/local/sbin/thinkpad-fn-f7
service acpid restart