<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blogging to Nowhere &#187; screen resolution</title>
	<atom:link href="http://webworxshop.com/tag/screen-resolution/feed" rel="self" type="application/rss+xml" />
	<link>http://webworxshop.com</link>
	<description>cat /dev/brain &#62; /dev/null</description>
	<lastBuildDate>Wed, 04 Jan 2012 02:45:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>Screen switching on the EeePC</title>
		<link>http://webworxshop.com/2009/02/12/screen-switching-on-the-eeepc</link>
		<comments>http://webworxshop.com/2009/02/12/screen-switching-on-the-eeepc#comments</comments>
		<pubDate>Thu, 12 Feb 2009 05:54:41 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[eeepc]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[screen resolution]]></category>
		<category><![CDATA[xrandr]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=45</guid>
		<description><![CDATA[I spend a lot of time working on my EeePC 901 using it's external monitor support, it's great, I have this little netbook, but when I plug it in to an external monitor, keyboard and mouse it pretty much turns into a desktop PC. The only drawback I've found so far is that there ...]]></description>
			<content:encoded><![CDATA[<p>I spend a lot of time working on my EeePC 901 using it&#8217;s external monitor support, it&#8217;s great, I have this little netbook, but when I plug it in to an external monitor, keyboard and mouse it pretty much turns into a desktop PC. The only drawback I&#8217;ve found so far is that there was no way to switch between the monitors in Ubuntu without going through the Screen Resolution configuration dialog. That was until I decided it had annoyed me for long enough and got Googling.</p>
<p>I found <a href="http://www.thinkwiki.org/wiki/Xorg_RandR_1.2">this</a> page, which documents the Xrandr, which can be used to configure monitors and screen resolutions from the command line. Some of the code snippets on the page got me into writing a script, which could toggle between the displays and be assigned to a hot key. I also added a mode to switch back to the laptop screen when there is not external screen (just in case my external monitor dies as happened in the <a href="/2009/02/03/another-auckland-power-outage-means-go-home-early">power cut</a> the other day!).<span id="more-45"></span></p>
<p><code>#!/bin/sh<br />
# names of outputs<br />
EXTERNAL_OUTPUT="VGA"<br />
INTERNAL_OUTPUT="LVDS"<br />
# external and internal resolutions<br />
EXTERNAL_RESOLUTION="1024x768"<br />
INTERNAL_RESOLUTION="1024x600"<br />
# if the external output is disconnected, then switch back to internal output<br />
xrandr | grep $EXTERNAL_OUTPUT | grep 'disconnected'<br />
if [ $? -eq 0 ]; then<br />
# just check to make sure we aren't on internal output already<br />
xrandr | grep $INTERNAL_OUTPUT | grep $INTERNAL_RESOLUTION<br />
if [ $? -eq 1 ]; then<br />
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off<br />
fi<br />
exit 0<br />
fi<br />
# check to see whether the external output is active<br />
xrandr | grep $EXTERNAL_OUTPUT | grep $EXTERNAL_RESOLUTION<br />
if [ $? -eq 0 ]; then<br />
# yep, we're currently using the external output, so switch back to the internal output<br />
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off<br />
else<br />
# otherwise we want to change to the external output<br />
xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT --mode $EXTERNAL_RESOLUTION<br />
fi<br />
exit 0</code></p>
<p>I assigned this to the Fn-F5 key combination using <a href="apt:eee-control">eee-control</a>, which I already have running on my eeepc. The result is really nice switching between internal and external outputs, which solved my problem perfectly.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2009/02/12/screen-switching-on-the-eeepc/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

