An easy way to fix this would be to start X from command line, with two different layouts. If you want to use graphical login, I suppose you need some program that will detect the monitor and start X with appropriate configuration, or alternatively make my check (below) before starting any display manager.
Anyways, my solution, which I had to apply to my laptop:
1) Make runlevel 3 the default in /etc/inittab, and if necessary, remove startup links to xdm, gdm or kdm from /etc/rc3.d (in debian). They are names like S99xdm or similar.
2) Add new monitor section to the /etc/X11/XF86Config-4 for the external monitor
3) Add new layout section to the same file, which uses external monitor
4) Start X with following commands, depending which monitor you want to use:
startx -- -layout your_internal_layout
startx -- -layout your_external_layout
You can edit the file .bash_profile in your homedir to ask which layout to use when you login:
echo "Is external monitor connected? (y/n)"
read yn
if [ "$yn" = "y" ]; then
startx -- -layout your_external_layout
else
startx -- -layout your_internal_layout
fi
That should work.
|