Much ado about scripting, Linux & Eclipse: card subject to change

Showing posts with label screen. Show all posts
Showing posts with label screen. Show all posts

2010-01-05

Switching monitors with xrandr

Sure, there are applets and other GUI tools to do this, but nothing beats the purity of going commando, er, commandline. :) Thanks to this article for the inspiration.

# reset 
xrandr --auto

# turn off laptop screen
xrandr --output LVDS --off

# 24" 16x12 on
xrandr --output VGA --mode 1600x1200

# reset 
xrandr --auto

# turn off external screen
xrandr --output VGA --off

# laptop screen on
xrandr --output LVDS --mode 1280x800

UPDATE, 2010/01/05:

To enable both screens and force the larger one to include the taskbar:

# reset 
xrandr --auto

# laptop screen on
xrandr --output LVDS1 --mode 1280x800 --noprimary --pos 1600x0

# 24" 16x12 on
xrandr --output VGA1 --mode 1600x1200 --primary --pos 0x0

# echo current status
xrandr --current

2008-11-06

xorg.conf: Fedora edition

After installing a Fedora 10 preview spin on my new Thinkpad X200 last week, I got to learn yet another way to generate and test an /etc/X11/xorg.conf file. Every time I upgrade my OS, my xorg.conf file gets simpler. I expect one day I won't need one at all!

Where in the past for *ubuntu I've used dpkg-reconfigure -phigh xserver-xorg, with Fedora I needed to discover a new way. Here's what I did.

  1. First, run man startx to see a sample /root/.xinitrc file
  2. Next, create a /root/.xinitrc file
     #!/bin/bash
     xrdb -load $HOME/.Xresources
     xsetroot -solid gray &
     xclock -g 50x50-0+0 -bw 0 &
     xload -g 50x50-50+0 -bw 0 &
     xterm -g 80x24+0-0 &
     screenruler &
     twm
  3. To generate a new config file, you can run:
     startx -- :2 -configure
  4. To test a given config file (other than the default, /etc/X11/xorg.conf):
     startx -- :2 -config /root/xorg.conf.new

The above steps let you be booted graphically @ default resolution, then switch to another vt (CTRL-ALT-F2, for example), log in, and try a new xorg.conf on a different video port without affecting your running instance. To kill a trial X, use CTRL-ALT-BkSp. To switch from vt2 to the existing graphical instance, use CTRL-ALT-F1 or CTRL-ALT-F7 (it should be on vt1 or vt7).

Once I was statisfied that the xorg.conf file worked, I rebooted. On restart, using xfce or gnome, I can now graphically switch from laptop @ 1280x800 to 24" external monitor @ 1600x1200, or run both screens at 1024x768, eg., for presentations.

2008-02-13

Dual-Monitor X.Org Configuration In Under 10 Minutes

If the above title shocks you, you're not alone. I'm still reeling from the fact that I was able to get a dual-monitor xorg.conf with almost no effort. Here's the steps:

  1. Check your ATI hardware specs.
    lspci | grep VGA
    01:00.0 VGA compatible controller: ATI Technologies Inc M56GL [Mobility FireGL V5200]
  2. Download the latest proprietary ATI Radeon driver from ati.amd.com.
  3. Quickly scan the documentation.
  4. Install the driver.
    chmod +x ati-driver-installer-8-01-x86.x86_64.run
    ./ati-driver-installer-8-01-x86.x86_64.run
  5. Configure X.Org. In my case, I have my external 1600x1200 monitor to the right of my 1400x1050 Thinkpad T60p. Of course, in "stretch" mode, both screens must be at the same resolution.
    aticonfig --dtop=horizontal --overlay-on=1 --mode2=1600x1200 \
        --resolution=0,1600x1200,1400x1050,1280x1024,1024x768 \
        --resolution=1,1600x1200,1400x1050,1280x1024,1024x768
  6. Restart X (I just hit CTRL-ALT-BkSp). If that breaks things, there's always CTRL-ALT-F1 to get back to a console.
  7. Change wallpaper from Centered to Tiled Maxpect so it's not stretched across both screens.
  8. Note the new K Menu entry for ATI Catalyst Control Center.
Thank you, AMD!