Open GoogleCodeExporter opened 9 years ago
I've come up with a really inelegant solution to this problem. Perhaps someone
else might benefit from this heap of a bash script I've crafted.
It uses xrandr to detect whether the internal LCD screen and an extenal HDMI
monitor are in use in the dumbest way possible by checking the panoramic
resolution.
If the resolution matches the one in the variable, it turns the screen off,
preventing programs and stuff from opening on your laptop screen so you can
close it without worry.
If it doesn't, it will turn the internal LCD back on if was off or if there was
no external monitor, it'll just leave things alone.
It's set up to work with an HDMI monitor, 1920x1080, set up on the left side of
your laptop. If you need to change the script, just run xrandr to see what your
setup should be.
What would be really sweet is if this script could be activated by the lid
closure "button."
I'm using the experimental nouveau 3d display driver on the VPCF11JFX. I don't
know if xrandr plays nice with the nvidia driver, so it may not work for
everyone.
Original comment by SpacePor...@gmail.com
on 30 Apr 2011 at 8:26
Attachments:
Well, here I go again. I just feel like I have to finish what I started, so
I've made this compatible with the nvidia drivers, which is nice because they
are more stable and have power management settings. By adding a mode for each
monitor configuration to the metamode line of the xconfig file, as detailed in
the second post of this thread: http://ubuntuforums.org/showthread.php?p=6480694
You can then use xrandr to switch between the modes. I made a bash script that
detects my current setting and then toggles to the next setting each time the
script is initiated. After assigning the script to the S1 button, I have a
pretty sweet way to toggle my display set up.
Original comment by SpacePor...@gmail.com
on 15 May 2011 at 1:14
Attachments:
Original comment by SpacePor...@gmail.com
on 12 Aug 2011 at 11:30
Attachments:
I did it! Lid closure now disables the laptop screen! I just used acpid to
detect the lid closure and a sweet script I pieced together from many searches.
Works with nouveau drivers, could easily conformed for nvidia, but wouldn't
have the luxury of the high resolution tty or hdmi connect/disconnect
autodetection.
Just follow my directions in this file. You will need to put it in
/etc/acpi/local.
Original comment by SpacePor...@gmail.com
on 15 Sep 2011 at 12:33
Attachments:
Ok, just configured it for the nvidia drivers because the system kept locking
up for some reason with the nouveau one. Here you go, just make sure to modify
your xorg.conf to something similar to what I have above. (you need the
metamodes for xrandr to work).
Original comment by SpacePor...@gmail.com
on 15 Sep 2011 at 1:02
Attachments:
Oh and here's a better version of the xorg.conf file.
Original comment by SpacePor...@gmail.com
on 16 Sep 2011 at 12:57
Attachments:
[deleted comment]
In summary: Lid state auto-adjust, HDMI state near auto-adjust.
Alright, I think I'm satisfied with the arrangement I have now. Lid closure is
properly detected and results in disabling the laptop display and making the
external display primary, opening the display with the HDMI cable attached
automatically extends the display with the external primary and the laptop on
the right. If the external display is not attached and the lid is opened, the
laptop is made primary display and the external one is not recognized.
An added bonus is that you no longer need to add those metamodes to your
xorg.conf if you don't want to because I now use disper instead of xrandr. I
have included my xorg.conf just in case you have problems with disper.
Original comment by SpacePor...@gmail.com
on 18 Sep 2011 at 4:17
Attachments:
Original issue reported on code.google.com by
SpacePor...@gmail.com
on 23 Feb 2011 at 2:48