Announcement

Collapse
No announcement yet.

What's the best series of actions for turning off a second monitor?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    What's the best series of actions for turning off a second monitor?

    Hi all,

    My main day-to-day computer is a Thinkpad X200s running Kubuntu 9.04 very happily. Recently, I noticed I had a spare monitor kicking around in my office at work and so started plugging that in and running a dual-monitor set-up, using xrandr to place the second monitor next to the first. (And oh wow: the first time I spun a desktop cube across two monitors I practically had to go and change my trousers.) I also need to get dual-monitor setups working smoothly as I do quite a lot of public speaking, and so need to plug into projectors.

    Anyway, here's the question. I have two little bash scripts - one for turning on the second monitor with xrandr and one for turning it off. I've learnt through trial-and-error that I need to have booted up the computer to at least the KDE login screen before plugging in the second monitor, as otherwise my laptop screen gets set to the wrong resolution. So everything is now great in terms of getting the second monitor on. But I think there must be a better series of actions for removing it at the end of the day. At the moment I'm doing this:

    1. Move any windows from the second monitor to the first
    2. Run the script to turn off the second monitor (xrandr --output VGA --off)
    3. unplug the second monitor

    However, when I turn the monitor off my laptop screen tends to do something a little strange: all the windows get resized vertically. For example, a firefox window might be set to the full height of the screen but then will be reset to only half the screen height after I run xrandr to turn off the second monitor. Sure, it's pretty trivial to resize the windows back to where they should be (except my Yakuake window, which gets shrunk vertically and can't be changed grrr), but this is the sort of thing that looks bad to potential Linux converts....

    If it helps, the screen section of my xorg.conf is as follows:

    Code:
    Section "Screen"
        Identifier   "Default Screen"
        Monitor     "Configured Monitor"
        Device     "Configured Video Device"
        SubSection "Display"           
            Virtual 2800 1024        
        EndSubSection              
    EndSection
    and my laptop monitor is 1280x800 and the second monitor 1024x768. Does anyone have any thoughts how I can turn off the second monitor without messing up all the windows on my main monitor?

    #2
    Re: What's the best series of actions for turning off a second monitor?

    Sorry for not having a solution off hand, but I'll play a bit with this myself because I connect my eeepc to a HDTV a lot. Could you please post the scripts you use so I can give it a shot? I also noted that if I boot connected to the HDTV, it gets autodetected correctly, but it screws the resolution in the lappy (it's set up to be the same as the much larger display of the HDTV).

    I am curious: what happens if you try to configure all of this from System Settings -> Display. Do we really still need to run scripts for this sort of thing? (this doesn't help potential converts, either :-( ) I am afraid of the answer

    Comment


      #3
      Re: What's the best series of actions for turning off a second monitor?

      Don't get too excited: my scripts are nothing clever. I have one called dualmonitor, which just contains:

      Code:
      #! /bin/bash
      xrandr --output VGA --auto --right-of LVDS
      and one called dualoff, which just contains:

      Code:
      #! /bin/bash
      xrandr --output VGA --off
      I totally agree that scripts don't feel like the best solution. I've tried using KRandRTray and the System Settings approaches, but haven't been able to get these working properly. In particular, although I've been able to use these tools to get the second monitor turned on and mirroring the contents of my laptop's main monitor, I've not been able to get the monitors showing different displays with them and have had to use scripts to get this working. It looks like Gnome users have a lot more graphical tools for these jobs than we KDE folk have, sadly. Look here for a list (the rest of that page is really useful, BTW, and is what I used to achieve what I've managed to achieve so far).

      Comment

      Working...
      X