Automatic switch to external monitor?

Hey all, I have a dock at work where I plop my laptop each day; used to be that as soon as I woke it, it would switch to using the external monitor only and never turn on the laptop screen. Now it turns on both even though the laptop is closed, and it takes me opening it and running my "dock" script (uses xrandr to turn off laptop display and enable external), shutting the laptop (which sleeps it), then waking it again. Quite irritating! Until recently this seemed to be automatic for me, but since switching monitors it isn't. I'm sure there's some way to do this via ACPI or whatever, but I'm not familiar enough with it to know. Basically i need an action for "docked" that will try running "dock on" and see what happens. Any thoughts?

On 26 January 2012 00:40, Jesper Reenberg
On 24 January 2012 21:42, Tom Davis
wrote: I'm sure there's some way to do this via ACPI or whatever, but I'm not familiar enough with it to know. Basically i need an action for "docked" that will try running "dock on" and see what happens. Any thoughts?
I have hacked some really nasty stuff together, hooking (un)dock events through an udev rule, which runs a shell script that exports my users xauthority and display settings and then tests whether or not the dock is present (thus determining if it was a dock og undock, as doing this in the udev rules with attributes didn't always work), and then use xrandr to set the monitors as i wan't. However most of this is IBM specific (i think).
And once more, such that everyone gets it (I'm used to the mail going to the list when just hitting reply). -- Reenberg

On Jan 25, 2012, at 6:42 PM, Jesper Reenberg
On 26 January 2012 00:40, Jesper Reenberg
wrote: On 24 January 2012 21:42, Tom Davis
wrote: I'm sure there's some way to do this via ACPI or whatever, but I'm not familiar enough with it to know. Basically i need an action for "docked" that will try running "dock on" and see what happens. Any thoughts? I have hacked some really nasty stuff together, hooking (un)dock events through an udev rule, which runs a shell script that exports my users xauthority and display settings and then tests whether or not the dock is present (thus determining if it was a dock og undock, as doing this in the udev rules with attributes didn't always work), and then use xrandr to set the monitors as i wan't. However most of this is IBM specific (i think).
Well, I *am* using a Thinkpad/dock, but I just wonder why it no longer "magically" works... But I'd hack stuff to make it!
And once more, such that everyone gets it (I'm used to the mail going to the list when just hitting reply).
-- Reenberg
participants (2)
-
Jesper Reenberg
-
Tom Davis