[ltp] Re: Any ACPI event for plugging in monitors?

David Abrahams linux-thinkpad@linux-thinkpad.org
Mon, 28 Aug 2006 17:11:05 -0400


Jiang Qian <qian2@fas.harvard.edu> writes:

> On Mon, Aug 28, 2006 at 04:04:33PM -0400, David Abrahams wrote:
>> Stefan Schmidt <stefan@sostec.de> writes:
>> 
>> > Hello.
>> >
>> >> I'd like to take some action whenever an external monitor is
>> >> plugged/unplugged from my T60p.
>> 
>> My driver already supports monitor hotplug; it disables monitors when
>> they're unplugged at least, and xrandr is used to ensure the desktop
>> fits on what remains.  I just don't know how to initiate some action
>> when a hotplug/hotunplug happens.
> Just my 2 cents. You can get by
> aticonfig --query-monitor
> and then you can probably use watch to continuously monitor its output 
> every seconds 

I know; I would use a cron job for that, but it seems awfully
inefficient.  I really don't want any needless periodic processes
running when my laptop is on batteries.

> and/or write a shell script to give yourself an event.

Do you really mean that plain "or" is an option here?  If so, how
would I write a shell script to give myself an event without
periodically querying connectivity?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com