<?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/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rough Book &#187; x</title>
	<atom:link href="http://vivin.net/tag/x/feed/" rel="self" type="application/rss+xml" />
	<link>http://vivin.net</link>
	<description>random musings of just another computer nerd</description>
	<lastBuildDate>Wed, 02 May 2012 18:20:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>An update to running aterm (or any other X app) rootless, without a DOS console on Cygwin</title>
		<link>http://vivin.net/2009/03/29/an-update-to-running-aterm-or-any-other-x-app-rootless-without-a-dos-console-on-cygwin/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://vivin.net/2009/03/29/an-update-to-running-aterm-or-any-other-x-app-rootless-without-a-dos-console-on-cygwin/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 23:46:08 +0000</pubDate>
		<dc:creator>vivin</dc:creator>
				<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[aterm]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[windows xp]]></category>
		<category><![CDATA[x]]></category>

		<guid isPermaLink="false">http://vivin.net/?p=406</guid>
		<description><![CDATA[A while ago, I wrote up a quick guide about running X/Windows applications (specifically, aterm) without root windows on Windows, using Cygwin. Recently I tried to set it up again and I realized that some of the information is slightly out of date. I&#8217;m also endeavoring to write a better guide. I&#8217;m assuming that you [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I wrote up a <a href="http://vivin.net/2007/03/27/running-aterm-or-any-other-x-app-rootless-without-a-dos-console-on-cygwin/" target="_blank">quick guide</a> about running X/Windows applications (specifically, <span style="font-family: courier new;">aterm</span>) without root windows on Windows, using Cygwin. Recently I tried to set it up again and I realized that some of the information is slightly out of date. I&#8217;m also endeavoring to write a better guide. I&#8217;m assuming that you have, at the very least, a decent understanding of building things from source. The process under Cygwin is pretty much the same as under any other *nix, but there are a few quirks. On the whole, it&#8217;s a whole lot easier than it used to be. This guide is primarily geared towards running <span style="font-family: courier new;">aterm</span> with a transparent background on a windows machine so that you can have a decent client for the Cygwin commandline, instead of the crappy Windows one.</p>
<p>I&#8217;m assuming that you already have Cygwin installed. If you don&#8217;t, you can get it from <a href="http://cygwin.com" target="_blank">here</a>. In addition to whatever other packages you have selected to customize your install, you also need development packages (gcc and friends), Xorg packages (headers, includes, and libraries), and a few graphics libraries (for <span style="font-family: courier new;">aterm</span>):</p>
<ul>
<li>Devel
<ul>
<li>gcc-core</li>
<li>gcc-g++</li>
<li>libXaw3d-devel (for <span style="font-family: courier new;">xv</span>)</li>
<li>libjpeg-devel (for <span style="font-family: courier new;">aterm</span>)</li>
<li>libpng12-devel (for <span style="font-family: courier new;">aterm</span>)</li>
</ul>
</li>
<li>Libs
<ul>
<li>jpeg (for <span style="font-family: courier new;">aterm</span>)</li>
<li>libXaw3d-devel</li>
<li>libXaw3d-7</li>
<li>libfreetype6</li>
<li>libjpeg-devel</li>
<li>libjpeg62 (for <span style="font-family: courier new;">aterm</span>)</li>
<li>libjpeg6b (for <span style="font-family: courier new;">aterm</span>)</li>
<li>libpng12 (for <span style="font-family: courier new;">aterm</span>)</li>
<li>libpng12-devel (for <span style="font-family: courier new;">aterm</span>)</li>
<li>libtiff5 (for <span style="font-family: courier new;">aterm</span>, <span style="font-family: courier new;">xv</span>)</li>
<li>zlib-devel (for <span style="font-family: courier new;">aterm</span>)</li>
<li>zlib0 (for <span style="font-family: courier new;">aterm</span>)</li>
</ul>
</li>
<li>Utils
<ul>
<li>bzip2 (to handle .bz2 files)</li>
</ul>
</li>
<li>X11
<ul>
<li>libX11-devel</li>
<li>xinit</li>
<li>xsetroot (if <span style="font-family: courier new;">xv</span> doesn&#8217;t work for you)</li>
</ul>
</li>
</ul>
<p>After Cygwin finishes installing those packages, grab the sources for <span style="font-family: courier new;"><a href="http://www.afterstep.org/afterimage/getcode.php" target="_blank">libAfterImage</a></span>, <span style="font-family: courier new;"><a href="http://sourceforge.net/project/showfiles.php?group_id=888" target="_blank">aterm</a></span>, and <span style="font-family: courier new;"><a href="http://www.trilon.com/xv/downloads.html" target="_blank">xv</a></span>. Unpack the sources perform the requisite steps to build and install from source (<span style="font-family: courier new;">./configure</span>, <span style="font-family: courier new;">make</span>, and <span style="font-family: courier new;">make install</span> should work if all goes well).</p>
<p><strong><span style="font-family: courier new;">libAfterImage:</span></strong></p>
<p>If you get <span style="font-family: courier new;">&#8220;parse error before XErrorEvent&#8221;</span> errors while building <span style="font-family: courier new;">libAfterImage</span>, make sure that you didn&#8217;t forget to select the X11 development package.</p>
<p><strong><span style="font-family: courier new;">aterm</span>:</strong></p>
<p><span style="font-family: courier new;">gcc</span> on Cygwin expects <span style="font-family: courier new;">&#8211;rdynamic</span> and not <span style="font-family: courier new;">-rdynamic</span>. If you&#8217;re seeing these errors, edit the Makefiles under <span style="font-family: courier new;">src</span> and <span style="font-family: courier new;">src/graphics</span> within the <span style="font-family: courier new;">aterm</span> source directory. Change the &#8220;-rdynamic&#8221; to &#8220;&#8211;rdynamic&#8221;. The changes should be on line 54 for both files.</p>
<p><strong><span style="font-family: courier new;">xv</span>:</strong></p>
<p>Under the <span style="font-family: courier new;">tiff</span> directory within the <span style="font-family: courier new;">xv</span> sources, there is a file called <span style="font-family: courier new;">RANLIB.csh</span>. Edit this file and make sure that you ONLY have the following line in there:</p>
<pre class="brush: php">
ranlib $1 &gt;&amp; /dev/null
</pre>
<p>Otherwise the build process will fail. Additionally, you need to edit <span style="font-family: courier new;">xv.h</span>. This file lives right at the root of your <span style="font-family: courier new;">xv</span> source directory. If you do not perform the following change, you&#8217;ll get errors from gcc complaining that &#8220;<span style="font-family: courier new;">sys_errlist</span> has previously been defined&#8221;. Change line 119 of <span style="font-family: courier new;">xv.h</span> to:</p>
<pre class="brush: php">
/*extern char *sys_errlist[]; */    /* this too... */
</pre>
<p>What you&#8217;re doing is commenting out the definition for <span style="font-family: courier new;">sys_errlist</span> so that it doesn&#8217;t conflict with what has already been defined in the Cygwin header files. These changes should be the only ones you need to get <span style="font-family: courier new;">xv</span> compiling and running.</p>
<p>Now you need to set up two batch files. One to start up X rootlessly, and another to start up <span style="font-family: courier new;">aterm</span>. Before you do that, make sure you add <span style="font-family: courier new;">C:\cygwin\usr\bin</span> and <span style="font-family: courier new;">C:\cygwin\X11R6\usr\bin</span> to your <span style="font-family: courier new;">PATH</span> variable. You can do this by going to <em>My Computer &gt; Properties &gt; Advanced &gt; Environment Variables</em>. If you don&#8217;t do this, you&#8217;ll get &#8220;cygwin1.dll not found&#8221; errors while trying to run these batch files. The X windows binaries used to live in <span style="font-family: courier new;">C:\cygwin\usr\X11R6\bin</span>, but have since been moved to <span style="font-family: courier new;">C:\cygwin\usr\bin</span>. Therefore, the start-up batch-file now looks like this:</p>
<p><strong><span style="font-family: courier new;">xwin.bat:</span></strong></p>
<pre class="brush: php">
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\usr\bin\xwin.exe -multiwindow -clipboard -silent-dup-error
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\usr\local\bin\xv.exe -display :0 -root -quit -be -max /cygdrive/c/Documents\ and\ Settings/vivin/My\ Documents/My\ Pictures/Wallpapers/01707_spectrumofthesky_1920x1200.jpg
</pre>
<p>The first line starts up the X windowing system. The second line sets the wallpaper using <span style="font-family: courier new;">aterm</span>. You now need another batch file to run <span style="font-family: courier new;">aterm</span>, and that looks like this:</p>
<p><strong><span style="font-family: courier new;">aterm.bat</span></strong></p>
<pre class="brush: php">
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\bin\bash.exe --login -i -c &quot;aterm -sh 80 -tr -trsb -fade 20 -tint gray -sb -st -sr -sl 1000 -tn xterm&quot;
</pre>
<p>This file starts <span style="font-family: courier new;">aterm</span> with the background image at 50% brightness, transparent background, transparent scrollbar, 20% fading on losing focus, gray tint, scrollbar, trough-less scrollbar, scrollbar on the right, 1000 scrollback lines, and with xterm terminal emulation. Like I mentioned in my original guide. <span style="font-family: courier new;">xv</span> will sometimes fail to start with <span style="font-family: courier new;">xwin</span>. If that is the case, you can modify <span style="font-family: courier new;">aterm.bat</span> to look like this:</p>
<p><strong><span style="font-family: courier new;">aterm.bat</span>:</strong></p>
<pre class="brush: php">
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\bin\bash.exe --login -i -c &quot;xv -display :0 -root -quit -be -max /cygdrive/c/Documents\ and\ Settings/vivin/My\ Documents/My\ Pictures/Wallpapers/01707_spectrumofthesky_1920x1200.jpg &amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp; aterm -sh 80 -tr -trsb -fade 20 -tint gray -sb -st -sr -sl 1000 -tn xterm&quot;
</pre>
<p>Slightly inefficient, but it works. Now if you have a dual-monitor display, you&#8217;ll notice that the background image is stretched across both screens when you run <span style="font-family: courier new;">aterm</span>. This is probably not what you want. To fix this problem you need to change a few invocation options for <span style="font-family: courier new;">xv</span>. For this to work properly (meaning, not look crappy) both screens should be running at the same resolution:</p>
<pre class="brush: php">
xv -display :0 -root -quit -be -maxpect -rmode 1 /cygdrive/c/Documents\ and\ Settings/vivin/My\ Documents/My\ Pictures/Wallpapers/01707_spectrumofthesky_1920x1200.jpg
</pre>
<p>Notice the <span style="font-family: courier new;">-maxpect</span> and <span style="font-family: courier new;">-rmode 1</span> options. <span style="font-family: courier new;">-maxpect</span> expands the image to fill the screen while maintaining the aspect ratio, while <span style="font-family: courier new;">-rmode 1</span> sets the display mode on <span style="font-family: courier new;">xv</span> to <span style="font-family: courier new;">tiled</span>. So you should now have your wallpaper displaying on both screens now (under X) without being distorted.</p>
<p>Here&#8217;s what it looks like on my machine:</p>
<p style="text-align: center;"><a href="http://vivin.net/pub/x_with_xp/xp_aterm_trans_dualmonitor.png" target="_blank"><img title="aterm running on XP under X with a dual-monitor setup" src="http://vivin.net/php/image.php?source=/home/vivin/www/pub/x_with_xp/xp_aterm_trans_dualmonitor.png&amp;type=png&amp;height=0.25&amp;width=0.25" alt="aterm running on XP under X with a dual-monitor setup" /></a></p>
<p>This is on a dual-monitor setup with both screens running at 1920&#215;1200 resolution. I&#8217;ve set X&#8217;s background to be the same as my windows Wallpaper so that it looks cooler. Notice how the background image (inside <span style="font-family: courier new;">aterm</span>) is not stretched, but tiled across the two screens. That&#8217;s all there is to it. Seems like a bit of work, but I think it&#8217;s worth it. My main reason for going through all this trouble was to get a decent terminal running in windows. I guess I could have just used <span style="font-family: courier new;">xterm</span>, but <span style="font-family: courier new;">aterm</span> looks so much nicer, doesn&#8217;t it?</p>
<br /><a href="http://vivin.net/?p=406#comments" title="Comments on &quot;An update to running aterm (or any other X app) rootless, without a DOS console on Cygwin&quot;"><img src="http://vivin.net/wp-content/plugins/feed-comments-number/image.php?406" alt="Comments" /></a><img src="http://vivin.net/?ak_action=api_record_view&#38;id=406&#38;type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vivin.net/2009/03/29/an-update-to-running-aterm-or-any-other-x-app-rootless-without-a-dos-console-on-cygwin/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:thumbnail url="http://vivin.net/php/image.php?source=/home/vivin/www/pub/x_with_xp/xp_aterm_trans_dualmonitor.png&#38;type=png&#38;height=0.25&#38;width=0.25" />
		<media:content url="http://vivin.net/php/image.php?source=/home/vivin/www/pub/x_with_xp/xp_aterm_trans_dualmonitor.png&#38;type=png&#38;height=0.25&#38;width=0.25" medium="image">
			<media:title type="html">aterm running on XP under X with a dual-monitor setup</media:title>
		</media:content>
		<media:content url="http://vivin.net/wp-content/plugins/feed-comments-number/image.php?406" medium="image">
			<media:title type="html">Comments</media:title>
		</media:content>
		<media:content url="http://vivin.net/?ak_action=api_record_view&#38;id=406&#38;type=feed" medium="image" />
	</item>
		<item>
		<title>Running aterm (or any other X app) rootless, without a DOS console on Cygwin</title>
		<link>http://vivin.net/2007/03/27/running-aterm-or-any-other-x-app-rootless-without-a-dos-console-on-cygwin/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://vivin.net/2007/03/27/running-aterm-or-any-other-x-app-rootless-without-a-dos-console-on-cygwin/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 23:14:04 +0000</pubDate>
		<dc:creator>vivin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[aterm]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[windows xp]]></category>
		<category><![CDATA[x]]></category>

		<guid isPermaLink="false">http://vivin.net/?p=370</guid>
		<description><![CDATA[This guide is outdated. Please check out the updated version of this guide here. On any system that I plan to use for an extended period of time, I will always install Cygwin. This is mainly because I like have UNIX tools on Windows, and also so that I can use the console to do [...]]]></description>
			<content:encoded><![CDATA[<p><strong>This guide is outdated. Please check out the updated version of this guide <a target = "_blank" href = "http://vivin.net/2009/03/29/an-update-to-running-aterm-or-any-other-x-app-rootless-without-a-dos-console-on-cygwin-/">here</a>.</strong></p>
<p>On <em>any</em> system that I plan to use for an extended period of time, I will always install <a target = "_blank" href = "http://cygwin.com">Cygwin</a>. This is mainly because I like have UNIX tools on Windows, and also so that I can use the console to do things that DOS is not able to do. I started using Cygwin in 2000, and I&#8217;ve continued using it since. One of the cool things you can do with Cygwin is run <a target = "_blank" href = "http://en.wikipedia.org/wiki/X_Window_System">X</a>, which means that you can have X applications running on the Windows desktop. When I was interning at <a target = "_blank" href = "http://motorola.com">Motorola</a>, I used to run <a target = "_blank" href = "http://www.hummingbird.com/products/nc/exceed/index.html?cks=y">eXceed</a>, with <a target = "_blank" href = "http://en.wikipedia.org/wiki/Fvwm">fvwm</a>. This was where I first ran into <a target = "_blank" href = "http://www.afterstep.org/aterm.php">aterm</a>. What I liked most about aterm is the eye-candy. You can have transparent windows with shading effects and all sorts of other cool stuff. I tried to get aterm running on my machine at home by compiling it from source under Cygwin. I was eventually able to do this (install <em>libjpeg</em>, <em>libpng</em>, <em>libAfterImage</em>, <em>zlib</em>, and the X includes and libraries first), but what I didn&#8217;t like was the fact that you had to start up a Cygwin console to open up X, and then aterm. I wanted aterm to start up and run directly without that ugly DOS/Cygwin console window. Of course, you can&#8217;t simply run the aterm executable because it needs X and Cygwin to be running. I eventually figured it out (actually a few months before leaving on my &#8220;extended vacation&#8221;) by starting out with X running with a rootless window. Oh, and <em>run.exe</em> proved to be very helpful. Anyway, here is how you do it:</p>
<p>First you need to add <em>C:\cygwin\bin</em> to your <em>PATH</em> Environment Variable. You can do this from <em>My Computer &#62; Properties &#62; Advanced &#62; Environment Variables</em>. You might also have to add <em>C:\cygwin\usr\X11R6\bin</em> to <em>PATH</em>.</p>
<p>Then you need to create two batch files. The first one is to start X, and the second one is to start aterm (or whatever X app you want to start). The example I&#8217;m going to show includes starting up X with a wallpaper (using <a target = "_blank" href = "http://www.trilon.com/xv/">xv</a>), and then running aterm. I run aterm with a transparent background, using the X wallpaper. However, you can also load aterm with a background image of your choice.</p>
<p>The batch file to start X, which I call <em>xwin.bat</em> looks like this:</p>
<pre class="brush: php">
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\usr\X11R6\bin\xwin.exe -multiwindow -clipboard -silent-dup-error
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\usr\local\bin\xv.exe -display :0 -root -quit -be -maxpect /cygdrive/c/Wallpapers/upper_limit_wp_dark_1600.jpg
</pre>
<p>This will start up X in a rootless window with <em>upper_limit_wp_dark_1600.jpg</em> as your X wallpaper. Next, you write a batch file (<em>aterm.bat</em>) that will load aterm:</p>
<pre class="brush: php">
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\bin\bash.exe --login -i -c &quot;aterm -sh 50 -tr -trsb -fade 20 -tint gray -bl -sb -st -sr -sl 1000 -tn xterm&quot;
</pre>
<p>This batch file will load aterm with the background image at 50% brightness, transparent background, transparent scrollbar, 20% fading on losing focus, gray tint, borderless window (sometimes works), scrollbar, trough-less scrollbar, scrollbar on the right, 1000 scrollback lines, and with xterm terminal emulation.  One issue I have had with this, is that aterm may load up with the default (checkered) X background. This is because the <em>xv</em> did not properly execute in <em>xwin.bat</em>. I have no idea why this happens, sometimes it works, and sometimes it doesn&#8217;t. If it doesn&#8217;t, you can modify <em>aterm.bat</em>:</p>
<pre class="brush: php">
C:\cygwin\usr\X11R6\bin\run.exe C:\cygwin\bin\bash.exe --login -i -c &quot;xv -display :0 -root -quit -be -max /cygdrive/c/Wallpapers/upper_limit_wp_dark_1600.jpg &amp;#38;&amp;#38; aterm -sh 50 -tr -trsb -fade 20 -tint gray -bl -sb -st -sr -sl 1000 -tn xterm&quot;
</pre>
<p>This batch file will load <em>xv</em> every time you start aterm, so there is a slight performance hit on startup. However, it&#8217;s not that big of a deal because the <em>xv</em> instance quits right after it sets up the wallpaper, and so you&#8217;re not loading a new instance of <em>xv</em> into the memory every time.</p>
<p>Well, there you have it. I hope it was helpful!</p>
<p style = "text-align:center">
<a target = "_blank" href = "http://vivin.net/pub/x_with_xp/x_with_xp.png"><img title = "X with XP" alt = "X with XP" class = ""   src = "http://vivin.net/php/image.php?source=/home/vivin/www/pub/x_with_xp/x_with_xp.png&amp;type=png&amp;height=0.42&amp;width=0.42" /></a><br />
<strong>Screenshot of my XP desktop, with aterm, xcalc, xclock, xeyes, and xterm running</strong></p>
<br /><a href="http://vivin.net/?p=370#comments" title="Comments on &quot;Running aterm (or any other X app) rootless, without a DOS console on Cygwin&quot;"><img src="http://vivin.net/wp-content/plugins/feed-comments-number/image.php?370" alt="Comments" /></a><img src="http://vivin.net/?ak_action=api_record_view&#38;id=370&#38;type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vivin.net/2007/03/27/running-aterm-or-any-other-x-app-rootless-without-a-dos-console-on-cygwin/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:thumbnail url="http://vivin.net/php/image.php?source=/home/vivin/www/pub/x_with_xp/x_with_xp.png&#38;type=png&#38;height=0.42&#38;width=0.42" />
		<media:content url="http://vivin.net/php/image.php?source=/home/vivin/www/pub/x_with_xp/x_with_xp.png&#38;type=png&#38;height=0.42&#38;width=0.42" medium="image">
			<media:title type="html">X with XP</media:title>
		</media:content>
		<media:content url="http://vivin.net/wp-content/plugins/feed-comments-number/image.php?370" medium="image">
			<media:title type="html">Comments</media:title>
		</media:content>
		<media:content url="http://vivin.net/?ak_action=api_record_view&#38;id=370&#38;type=feed" medium="image" />
	</item>
	</channel>
</rss>

