Handling EEE-PC 701 ACPI events and internal/external screen switching

I started writing this small program because different special keys of the EEE-PC 701 were not supported. This time is over for all special keys but the internal/external monitor switching. I’ve updated it to better detect available modes. So here is version 1.3.

So lets sum up. Normally, as of today, most of the Linux distribution handle pretty well the following keys:

  • Sound management
  • Wifi on/off
  • Sleep
  • Web cam on/off

The only on that remains not supported is internal/external screen switching. This is provided by this program. It monitors ACPI events and detect the one that is triggered when you press the screen switching key. When pressing this key, the program switch between internal screen only, both screen and external screen only. It will choose the best available resolution provided by the external display and compatible with the EEE-PC 701.

In addition, this program can send a notification concerning the AC on/off status or batterie status. You can switch these on/off.

Usage : /usr/local/bin/eee_acpi [options]

  • -b : Disable batterie notifications
  • -a : Disable AC notifications
  • -v : Disable volume handling/notifications
  • -x : Disable internal/external screen switch

This program is to be launched when X starts. You can do this with one of the following methods:

1/ Create the following script called eee_acpi in /etc/X11/xinit.d and set exec rights.

#!/bin/sh
killall /usr/local/bin/eee_acpi
/usr/local/bin/eee_acpi -v -b

2/ Create the file $HOME/.config/autostart/eee_acpi.desktop with this content:
[Desktop Entry]
Name=eee_acpi
Comment=EEE ACPI user events handling
Exec=eee_acpi -b -v
Terminal=false
StartupNotify=false

Restart X and you are done.

On my EEE-PC I turned off batterie notification and sound management.

Note that you should install the following packages for the notifications to work:

  • libnotify: provides notify-send;
  • notification-daemon: displays notifications.

Note this might not work with over devices. But I think you can easily adapt it to your needs. Just change the events in the source and use acpi_listen to see which events you need to handle.

This entry was posted in EEE PC, mandriva. Bookmark the permalink.

Comments are closed.