<?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>literal thoughts &#187; linux</title>
	<atom:link href="http://blog.nix.is/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.nix.is</link>
	<description>Come for the thoughts, stay for the rants</description>
	<lastBuildDate>Tue, 01 Sep 2009 13:15:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Theming the Linux console</title>
		<link>http://blog.nix.is/theming-the-linux-console</link>
		<comments>http://blog.nix.is/theming-the-linux-console#comments</comments>
		<pubDate>Tue, 29 Apr 2008 05:03:42 +0000</pubDate>
		<dc:creator>Hinrik Örn Sigurðsson</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.nix.is/?p=9</guid>
		<description><![CDATA[While messing with my Linux console recently, I stumbled upon the console_codes(4) man page. Apparently there are Linux-specific escape codes to redefine the color palette. Awesome! I&#8217;ve always preferred the &#8220;Tango&#8221; terminal palette that recently became the default in gnome-terminal. Now I can use it outside of X.
Everybody likes screenshots: before and after.
Update: Apparently PuTTY [...]]]></description>
			<content:encoded><![CDATA[<p>While messing with my Linux console recently, I stumbled upon the <a href="http://kerneltrap.org/man/linux/man4/console_codes.4">console_codes(4)</a> man page. Apparently there are Linux-specific escape codes to redefine the color palette. Awesome! I&#8217;ve always preferred the <a href="http://uwstopia.nl/blog/2006/07/tango-terminal">&#8220;Tango&#8221; terminal palette</a> that recently became the default in <code>gnome-terminal</code>. Now I can use it outside of X.</p>
<p>Everybody likes screenshots: <a href="http://blog.nix.is/wp-content/uploads/2008/04/before.png">before</a> and <a href="http://blog.nix.is/wp-content/uploads/2008/04/after.png">after</a>.</p>
<p><strong>Update:</strong> Apparently <a href="http://en.wikipedia.org/wiki/PuTTY">PuTTY</a> supports these escapes as well.<br />
<span id="more-9"></span></p>
<p>Using the escape codes to change the palette is quite laborious, so I decided to write a small program to make it easier to switch between various palettes. You can find it <a href="http://search.cpan.org/dist/App-ConPalette">here</a>.</p>
<p>There is one problem though. The Linux console doesn&#8217;t allow you to set the default foreground/backround colors independently of the color palette, as you can do in most GUI terminal emulators. In the absence of any ANSI color espaces, Linux uses the first and last colors of the palette for the background and foreground (text), respectively. This means that if I were to reuse the Tango palette verbatim in the Linux console, the background would be dark grey and the text would be almost white. This makes man pages harder to read, and I prefer a black background with medium gray text anyway, as is the default in the Linux console. To solve this, I created a palette called &#8220;tango-dark&#8221; with the first color black and the last color medium grey, and called the unmodified palette &#8220;tango-light&#8221;.</p>
<p>In addition to the <code>gnome-terminal</code> palettes (rxvt, tango, xterm), I also added KDE Konsole&#8217;s palette, as well as the color palette used by the <a href="http://en.wikipedia.org/wiki/List_of_8-bit_computer_hardware_palettes#ZX_Spectrum">Sinclair Spectrum</a>, since it mostly fits the ANSI palette (it has black listed twice, so I replaced one with a dark grey color, which it was missing).</p>
<p>So, assuming Perl is installed, the program can be installed on most distributions in the following manner:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># cpan -i App::ConPalette</pre></div></div>

<p>Then do:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">conpalette --help</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.nix.is/theming-the-linux-console/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
