On The Road with Vicky Lamburn

The murmurings of another voice in the congregation

Posts Tagged ‘XrandR

OutputSwitcher 0.2 – Much improved

with 5 comments

Ok, first of all it’s not here because the actual code is spare three lines identical to 0.1. The big difference is that the Fn+F7 part is now controlled thankfully via ACPI. ACPI in this case is the ‘thing’ that triggers hotkey events such as Fn+F7. This means the script is called in a much neater way in the system.

I’m sure many Linux gurus will be like, “Yeah so what–we knew this anyway.” Well I’ve found it now, how to call the script on an ACPI event. So this will make whatever work I do from here a lot cleaner.

I’ll post it soon.

Also I have a stack of emails to reply to, and comments here too. I’ll do my best to answer ASAP; as it’s fair and this blog has had quiet days and I’m really appreciative of all the wonderful feedback and so forth :) Lil old me eh, who’d have thought it; using Linux for a mere three months and already hacking around getting some stuff working fairly simply. That’s what I love about Linux in 2007; it mostly on supported hardware works great and allows you to work, but if something doesn’t work, it’s almost like you’ve got the right to rewrite the bits that are broken, with a closed source OS you’d be dependent on the vendor for that!

I hope one day I’ll get back to LyX and writing Memoirs of a Time… :) After all that is my real passion.

Written by lilserenity

October 30, 2007 at 9:54 pm

Output Switcher – Easy Linux Screen Management

with 11 comments

Whew what a productive day.

I’ve written a script to easily switch between LCD, VGA, LCD+VGA Mirror, LCD+VGA Extended Desktop (Dual Screen) on a ThinkPad and other Radeon based laptops; for all systems using Xrandr 1.2 and Xorg 7.3; such as Ubuntu 7.10 Gutsy Gibbon.

It works well and can be bound to the Fn + F7 key combination. It’s not perfect, it’s basic but it does what I need it to do, does it well and it’s minimal. I will develop it further in time with a GUI and complete reconfigurability.

At its simplest, this is the easiest way to make the most of your external VGA screen, easiest way to mirror and the easiest way to to create dual screen setups on a ThinkPad on Ubuntu and Linux. Probably. Well once it’s installed it just sits there and works Read on to find out more…

The inevitable bug reports as comments on this post would be good. As would your feedback. Please be nice :)

Download: OutputSwitcher.zip

Read the rest of this entry »

Written by lilserenity

October 21, 2007 at 10:36 pm

Ecstatic: XrandR 1.2 means decent Linux Screen Management at Last

with 44 comments

Let me sum it up in about three words:

It just works.

Let me kid you not this is huge news. The only downside is that the GUI is not there yet but any one with a basic idea about the terminal and the command line can see this working now in its full glory; in my case I’ve tested it with Ubuntu 7.10 Gusty Gibbon (release candidate.)

Easy Radeon TV Out and Linux

Ok, I’m not sure how well this works on other Radeon GPUs but on my T40 which has a basic Mobility Radeon 7500. A popular chip that has been in many machines from Apple, Dell, other IBMs and many more. But hasn’t it been a complete stupdity basically; no ill meaning meant for those who have made solutions and worked on previous code. Here’s what you need on the command line to enable S-video output:

xrandr --addmode S-video 800x600
xrandr --output S-video --mode 800x600

That’s it. It works.

Only downside is PAL does not seem to work at present (scrambled display) but NTSC works fine. Only downside is many CRT PAL TVs will show NTSC in black and white. However some PAL TVs can cope with 60Hz NTSC signals fine. It works great here!

VGA Output

Ok I have a VGA output on my T40 but it could easily be a DVI output if need be. To mirror generally all you need to do is plug in the display and it works. To see what xrandr has detected as such; type in xrandr at the prompt and ‘magically’ it’s found the resolutions it believes the screen can display though sometimes these can be lies. But mostly it’s correct.

So if I had a 1024×768 main display and wanted to mirror at that resolution, I’d enter:

xrandr --output VGA-0 --mode 1024x768

That’s it.

Turn off Display

Say I wanted to turn off my laptop display:

xrandr --output LVDS --off

Or if I wanted to turn off the DVI output:

xrandr --output DVI-0 --off

Extend Desktop over two displays

(Say my laptop display is 1024×768 and my external display to the right is 1600×1200.)

This requires in my case one tweak to the xorg.conf file on a Radeon 7500 using the ‘radeon’ driver. In the Screen section by default you should see something like:

Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies Inc Radeon..."
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Modes "1024x768"
Virtual 2624 1200
EndSubSection
EndSection

The addition is the Virtual line where the size is the maximum width of the displays added together by the height of the biggest resolution height. So in this case the width is 1024+1600 = 2624. Between my laptop and external screen, the latter has the highest vertical resolution so that’s 1200 (instead of 768.)As another example I have a 1400×1050 laptop screen and a 1440×900 external screen so:

  • Width: 1400 + 1440 = 2840
  • Height: (1050 is larger than 900 so…) = 1050
  • So the line to insert is: Virtual 2840×1050

After sorting out the xorg.conf file from the command line after restarting the X Server (Ctrl+Alt+Backspace, Log Out or Reboot) enter:

xrandr --output VGA-0 --right-of LVDS
xrandr --output VGA-0 --mode 1600x1200

That’s it. Not quite as straight forward but still bloody simple. All we need now is a robust GUI and we’re laughing!

Conclusion

This is such a big improvement it’s not funny. This almost brings Linux up to speed with Windows and Mac OS X with regards to screen management. All it needs is a decent robust GUI and I may step up to this challenge…

I believe the radeon, nv and intel drivers support xrandr 1.2. Please let me know if others do. Certainly the radeon driver does.

Written by lilserenity

October 15, 2007 at 9:05 pm

Ubuntu, XrandR 1.2 and the whole thing

with 3 comments

Before I went on holiday I made some discoveries.

Firstly Ubuntu’s new configuration tool for screens and displays only sets up multi screen situations using Xinerama. The new ATI (ati) and Radeon (radeon) open source drivers do not support Xinerama any more. Therefore that’s why the options are disabled.

Tapping xrandr into a terminal yields everything correctly now; and it’s a doddle to mirror, extend, change resolution and rotate any connected device which it detects via hot plugging and it works a bloody treat on my ThinkPad T40.

Ubuntu Gutsy seems a lot more inviting now. Also a GUI has been developed using PyGTK, find out more here: http://albertomilone.com/wordpress/

Written by lilserenity

October 14, 2007 at 9:54 pm