Problem with ACPI events while docking.

Solaris, RedHat, FreeBSD and the like
Post Reply
Message
Author
Szelek
Posts: 8
Joined: Thu Feb 28, 2008 9:22 am
Location: Warsaw, Poland

Problem with ACPI events while docking.

#1 Post by Szelek » Thu Oct 09, 2008 9:23 am

Hi.
I recently bought port replicator II, and it works great, but i have a question. I know that there is a possibility to automatically switch view to attached display (for example) when docking, using ACPI events. I have set all the other FN+Fx events, but I don't know how to make this thing working.
Thanks in advance.

Szelek
ThinkPad T40 /2373-1U1/

lightweight
Sophomore Member
Posts: 234
Joined: Sat Jun 30, 2007 10:56 pm
Location: L. A.

#2 Post by lightweight » Fri Oct 10, 2008 9:52 pm

Its a little tricky to trigger an event with docking because (at least on X60s and X61s with Ultrabase) acpi_listen doesn't return anything useable. I always have power on my dock, though, so instead I just added a check when ACPI detects the AC adapter. You could save this as, say, /etc/acpi/ac.d/90-dock.sh

Code: Select all

#!/bin/sh
#requires thinkpad_acpi
STATUS=`/bin/cat /sys/devices/platform/thinkpad_acpi/subsystem/devices/dock.0/docked`

# if its docked,do this
if [ $STATUS -eq 1 ] ; then
        # replace with however you enable your external monitor
        /usr/bin/xrandr --output VGA --auto
        # do whatever else you want.

# if its undocked, do this
else
        /usr/bin/xrandr --output VGA --off
fi
There's got to be a better way to do this, I just don't know how -- anybody know the ACPI event for docking and undocking?
Have: x60s ultralight 1705-CTO, Debian SiD, Linux 2.6.25-2 | x61s ultralight 7668-CTO, Debian SiD/Experimental, Linux 2.6.27-git5 | Model M 1391401, white label, 07-17-91
Had: x22, Debian Testing/SiD, Linux 2.6.18-22

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Linux Questions”

Who is online

Users browsing this forum: No registered users and 0 guests