tvogel / vaio-f11-linux

Automatically exported from code.google.com/p/vaio-f11-linux
7 stars 2 forks source link

Using external monitor, lid closure disable should disable laptop screen. #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is not really a serious problem, but I would really like it if when I'm 
using my external monitor and I close the lid of the laptop, if the internal 
LCD screen would automatically disable so I wouldn't need to worry about 
windows or my cursor moving to the closed screen. It works that way in W7.  

What version of the product are you using? On what operating system?
I'm using VPCF11JFX with Kernel 2.6.35 on ubuntu 10.10

Please provide any additional information below.
I tried changing the power settings to have the laptop screen go blank upon lid 
closure, but it still counts as an active screen. It seems much of the display 
detection is not very robust, as unplugging the HDMI cable does not 
automatically disable the external monitor registering as an active screen 
either. 

I'm a pretty big linux noob, so there's probably something really dumb I'm not 
doing... Sorry....

Original issue reported on code.google.com by SpacePor...@gmail.com on 23 Feb 2011 at 2:48

GoogleCodeExporter commented 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:

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago

Original comment by SpacePor...@gmail.com on 12 Aug 2011 at 11:30

Attachments:

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

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: