[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Switching to external monitor.



Hi,

Typically, what I want is that a laptop detects when an external monitor
is plugged/unplugged, then execute the user preferred action for _that_
device ("xrandr --auto" or open grandr or use an arandr [wnpp 484849]
profile or others[6]...).


This should be possible !

ACPI[1] is supposed to know which devices are connected[2] and generate
an event[3][4] when a monitor is plugged/unplugged.

The state is exported in sysfs [2][5]
> grep "" /sys/class/video_output/*/state
> /sys/class/video_output/acpi_video0/state:0000001f
> /sys/class/video_output/acpi_video1/state:0000000d
> /sys/class/video_output/acpi_video2/state:0000001d
> /sys/class/video_output/acpi_video3/state:0000001f
> /sys/class/video_output/acpi_video4/state:0000000d
> /sys/class/video_output/acpi_video5/state:0000001d

I don't receive such acpi event on my system (Thinkpad T60).
What about you ?

Franklin

On Sun, 2008-06-22 at 10:33 -0400, Carl Fink wrote: 
> On Sat, Jun 21, 2008 at 09:22:16PM +0000, Jack Malmostoso wrote:
> > On Sat, 21 Jun 2008 20:40:11 +0200, Franklin PIAT wrote:
> > 
> > > I'm wondering how you handle this. Any great idea we could enable in
> > > Lenny ?
> > 
> > grandr is your friend.
> 
> There was an article on this very subject in last month's Linux Journal.

I couldn't find it. Is it available online ?


--

[1] http://acpi.info/DOWNLOADS/ACPIspec30b.pdf
[2] above specs: B.6.6 _DCS (Return the Status of Output Device)
[3] above specs: B.5 Notifications for Display Devices
[4] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/acpi/video.c#l1813
[5] /usr/share/doc/linux-doc-2.6.25/Documentation/video-output.txt.gz
[6] http://www.thinkwiki.org/wiki/Sample_Fn-F7_script


Reply to: