<?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>blog of pesa</title>
	<atom:link href="http://blog.pesa.se/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pesa.se</link>
	<description></description>
	<lastBuildDate>Sat, 14 Jan 2012 18:09:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>.Xdefaults vs .Xresources</title>
		<link>http://blog.pesa.se/2012/01/14/xdefaults-vs-xresources/</link>
		<comments>http://blog.pesa.se/2012/01/14/xdefaults-vs-xresources/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 18:09:28 +0000</pubDate>
		<dc:creator>pesa</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[X]]></category>

		<guid isPermaLink="false">http://blog.pesa.se/?p=65</guid>
		<description><![CDATA[Many X programs have user-level configuration options that can be set in the X server&#8217;s resource database. The two most common ways to achive persistent configuration for your X programs are to store them in either ~/.Xdefaults or ~/.Xresources files. I will not go into detail of the syntax of these files. However, there are [...]]]></description>
			<content:encoded><![CDATA[<p>Many X programs have user-level configuration options that can be set in the <a href="http://en.wikipedia.org/wiki/X_resources" title="X resources">X server&#8217;s resource database</a>.</p>
<p>The two most common ways to achive persistent configuration for your X programs are to store them in either <code>~/.Xdefaults</code> or <code>~/.Xresources</code> files.</p>
<p>I will not go into detail of the syntax of these files. However, there are some things to take into consideration between the choice of the two files.</p>
<p>Consider the X program <code>xterm</code>. You want to make the background black and the foreground white. This can be achived by passing some command line arguments to <code>xterm</code>:</p>
<blockquote><p><code>$ xterm -bg black -fg white</code></p></blockquote>
<p>This is fine if you want this for only one time, but if you want it to be the default you put it in a configuration file.</p>
<blockquote><p><code>XTerm*background: black<br />
XTerm*foreground: white</code></p></blockquote>
<p>If you put this in the <code>~/.Xdefaults</code> file you will notice that the next time you start an <code>xterm</code> it has the new colors. Great! Or, is it?<br />
It is easy to change configuration options and it will be in effect next time you start the program, but it comes at the cost that basically all X programs needs to parse this file everytime you run one.</p>
<p>A better way is to put the configuration options in the <code>~/.Xresources</code> file and store the configuration in the X server&#8217;s resource database by using the <code>xrdb</code> command:</p>
<blockquote><p><code>$ xrdb -merge ~/.Xresources</code></p></blockquote>
<p>Doing this, (in simple terms) <code>xterm</code> will &#8220;ask&#8221; the X server for its resource options rather than reading a file. This is much quicker and avoids unnecessary reads on disk.<br />
Another great thing about this is that remote X programs (e.g., tunneled through SSH) will be able to catch these options.</p>
<p>Once configurations are read into the X server&#8217;s resource databse (using <code>xrdb</code>), X programs should not look for configuration options in <code>~/.Xdefaults</code> file.</p>
<p>As many desktop environments (like Gnome or KDE) will store the configurtion from both files into the resource database upon the start of X, the drawbacks stated above may not be a problem.<br />
However, if you don&#8217;t run a desktop environment (like me) you need to manually run <code>xrdb</code> when starting X (e.g., by adding <code>xrdb</code> command line above to the <code>~/.xinitrc</code> file).</p>
<p>If you run <code>xrdb</code> manually, you can of course name the <code>~/.Xresources</code> file whatever you want, but it&#8217;s the defacto standard.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pesa.se/2012/01/14/xdefaults-vs-xresources/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Experimenting with window managers</title>
		<link>http://blog.pesa.se/2009/07/18/experimenting-with-window-managers/</link>
		<comments>http://blog.pesa.se/2009/07/18/experimenting-with-window-managers/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 21:45:33 +0000</pubDate>
		<dc:creator>pesa</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.pesa.se/?p=15</guid>
		<description><![CDATA[My current window manager that I&#8217;m using, and have used for the last two years, is called wmii (window manager improved 2).  Not going into details with wmii, but I experimented and &#8220;hacked&#8221; around with it quite much in the beginning. The problem was though, while I was doing this I couldn&#8217;t keep my regular [...]]]></description>
			<content:encoded><![CDATA[<p>My current window manager that I&#8217;m using, and have used for the last two years, is called <a title="window manager improved 2" href="http://wmii.suckless.org/">wmii</a> (window manager improved 2).  Not going into details with wmii, but I experimented and &#8220;hacked&#8221; around with it quite much in the beginning. The problem was though, while I was doing this I couldn&#8217;t keep my regular applications running (browser, mail/chat client, etc.) since I needed to restart the X session regularly.</p>
<p>Then I found out about <a title="Xephyr" href="http://www.freedesktop.org/wiki/Software/Xephyr">Xephyr</a>, which basically is an X server which targets a window of another X server as its framebuffer. Making it possible to run a window manager inside of another window manager, for instance.</p>
<p>Xephyr is a great tool to use even if you&#8217;re not developing. For instance, it could be used to try out different kinds of window managers. There are quite many out there worth taking a <a title="Window Managers for X" href="http://xwinman.org/">look at</a>.</p>
<p>Anyway, it can be a bit tricky to get Xephyr running if you&#8217;re not all that into how X works, so I&#8217;ll save you the hassle and tell you how I used it.</p>
<p>I wrote a wrapper script called <strong>xephyr</strong> (note: small &#8220;x&#8221;) which simplified the usage, having the options I always want to use.</p>
<blockquote><pre>#!/bin/sh

DPY=":1.0"
RES="1024x768"

Xephyr $DPY -ac -kb -screen $RES "$@"
</pre>
</blockquote>
<p>Some explanation:</p>
<ul>
<li><code>DPY</code> variable is the name of the display for the Xephyr session. You will need it later on in order to attach an X application to your Xephyr session</li>
<li><code>RES</code> variable is the resolution for the Xephyr session, i.e., a window with that resolution will be created</li>
<li><code>-ac</code> argument is for disabling access control restrictions, which isn&#8217;t really necessary when experimenting. It saves us a lot of hassle</li>
<li><code>-kb</code> argument is for disabling the X keyboard extension. This allows you to use any key binding within your Xephyr session</li>
<li>The <code>"$@"</code> will allow you to add additional arguments to Xephyr through the wrapper script. See <code>Xephyr -help</code> for more options</li>
</ul>
<p>Save the script to a directory which is in your <code>PATH</code> (e.g., <code>/usr/local/bin</code> or <code>~/bin</code>), and don&#8217;t forget to chmod it (<code>chmod +x xephyr</code>).</p>
<p>Now, in order to start Xephyr just execute the wrapper script (it will run in the foreground of your terminal, and will output information from the Xephyr session which might be useful if you&#8217;re developing):</p>
<blockquote><p><code>$ xephyr</code></p></blockquote>
<p>At this moment you will have a window which contains an empty X session. So, what we need now is to attach a window manager to it. That is done by starting the window manager (in my case wmii) with the environment variable <code>DISPLAY</code> set to the display the Xephyr session is using (in our case &#8220;:1.0&#8243;):</p>
<blockquote><p><code>$ DISPLAY=":1.0" wmii</code></p></blockquote>
<p>If the window with the Xephyr session has focus, it will pass on most keystrokes to that session, but the window manager inside of Xephyr might have key bindings which could collide with your real window manager (if so, they will get overridden by the real one). To exclusively use keyboard and mouse within the Xephyr session, press <code>CTRL+SHIFT</code> (i.e., press <code>CTRL</code> first, then also press <code>SHIFT</code>). That will allow Xephyr to grab all keyboard and mouse events (<code>CTRL+SHIFT</code> will also release it).</p>
<p>That is all. Happy experimenting! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pesa.se/2009/07/18/experimenting-with-window-managers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>About that time, eh chaps?</title>
		<link>http://blog.pesa.se/2009/07/18/about-that-time-eh-chaps/</link>
		<comments>http://blog.pesa.se/2009/07/18/about-that-time-eh-chaps/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 19:02:43 +0000</pubDate>
		<dc:creator>pesa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.pesa.se/?p=7</guid>
		<description><![CDATA[&#8230; Right-oh! It has now been quiiite a while since my last (and only) post, and after a couple of pushes from my friend wildcard I&#8217;ve decided to give this blogging thing another go. There is always some cool things that you learn along the road that is worth telling about. I just need to [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; Right-oh!</p>
<p>It has now been quiiite a while since my last (and only) <a title="Goodbye Big-bloated-OTR-button" href="http://blog.pesa.se/2007/09/25/goodbye-big-bloated-otr-button/">post</a>, and after a couple of pushes from my friend <a title="blog.padowi.se" href="http://blog.padowi.se/">wildcard</a> I&#8217;ve decided to give this blogging thing another go.</p>
<p>There is always some cool things that you learn along the road that is worth telling about. I just need to take the time to write them down in order to share them :)</p>
<p>I already got a couple of ideas of some topics that I want to write about, and wildcard has been kind to give me a couple of hints as well. So, stay tuned, there might pop-up some posts in the near future (and by future I do not mean as in ~2 years&#8230; I hope ;))</p>
<p>P.S. For you who did not get the initial reference, it&#8217;s from the <a title="End of the World" href="http://www.endofworld.net/">&#8220;End of the World&#8221;</a> flash movie. D.S.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pesa.se/2009/07/18/about-that-time-eh-chaps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Goodbye Big-bloated-OTR-button</title>
		<link>http://blog.pesa.se/2007/09/25/goodbye-big-bloated-otr-button/</link>
		<comments>http://blog.pesa.se/2007/09/25/goodbye-big-bloated-otr-button/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 13:57:45 +0000</pubDate>
		<dc:creator>pesa</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.pesa.se/2007/09/25/goodbye-big-bloated-otr-button/</guid>
		<description><![CDATA[Are you using the Off-the-Record messaging plugin for Pidgin? Ever get annoyed by the big bloated button? How many times have you accidently hit that button and annoyed your friends who doesn&#8217;t use this neat plugin, which in turn starts asking you what the heck is going on? If your answer is yes in any [...]]]></description>
			<content:encoded><![CDATA[<p>Are you using the <a href="http://www.cypherpunks.ca/otr/">Off-the-Record</a> messaging plugin for <a href="http://www.pidgin.im/">Pidgin</a>?<br />
Ever get annoyed by the big bloated button?<br />
How many times have you accidently hit that button and annoyed your friends who doesn&#8217;t use this neat plugin, which in turn starts asking you what the heck is going on?</p>
<p>If your answer is yes in any of these questions, then this post might be of interest to you!</p>
<p><img src="http://blog.pesa.se/wp-content/uploads/2007/09/bloated-pidgin-otr.png" alt="bloated-pidgin-otr" /><br />
<em>Pidgin message dialog with bloated OTR button</em></p>
<p><strong>Background:</strong><br />
Since I got tired of that bloated button I decided to investigate if it would be possible to resize and/or move it somewhere else, where it wouldn&#8217;t be as easy to hit by accident. And since there were no configuration for doing that, I started to look at the source code for the plugin and managed to find where in the code the button was actually rendered. (I know that you can remove the OTR button from a contact by having specific OTR settings on that specific contact. First of all, I think it would be tedious to do that for every contact you don&#8217;t use OTR with. And secondly, contacts that I <em>DO</em> use OTR with, I&#8217;d still have that bloated button in my face ;))</p>
<p><strong>What I did:</strong><br />
I removed the icon, since I thought it was just ugly and taking space. But instead of an icon, I color coded the different OTR status types. (Thank you for the great suggestions, wildcard :))</p>
<p>Finally the button was moved to the right in the formatting toolbar. Yes, I know this might not be the nicest&#8230; whatever, but I had a hard time trying to get it to be any good by doing it different. The problem was that if I wanted it to be on the right hand side of the message input area, I guess I&#8217;d also need to change some the pidgin source, because it seemed that the message input area was rendered with right alignment after the OTR button was rendered, and thus the OTR button would still end up being on the left hand side of the message input area. I&#8217;m not sure if that&#8217;s the case, but it seemed to be that way. And to start hacking on the pidgin source, would probably only complicate things even more.<br />
Anyway, even though I don&#8217;t use formatting myself, it was a small price to pay :)</p>
<p><strong>The result:</strong><br />
<img src="http://blog.pesa.se/wp-content/uploads/2007/09/cleaner-pidgin-otr.png" alt="cleaner-pidgin-otr" /><br />
<em>Pidgin message dialog with a bit cleaner OTR button</em></p>
<p><strong>How you&#8217;ll do it:</strong><br />
Obviously, you will need the pidgin-otr source to apply this patch. And this patch is for version 3.1.0. If you have any of the previous OTR plugins installed, or version 3.1.0 installed from your package manager, it must be uninstalled first.<br />
(Note! You will need the OTR library and toolkit (libotr) to be able to compile pidgin-otr. Further information about OTR setup at <a href="http://www.cypherpunks.ca/otr/">http://www.cypherpunks.ca/otr/</a>)</p>
<ol>
<li>Standing in your pidgin-otr source folder, execute the following if you have OTR currently installed<br />
<blockquote><p><code>$ sudo make uninstall &amp;&amp; make clean</code></p></blockquote>
</li>
<li>Download the patch into the source folder<br />
<blockquote><p><code>$ wget http://blog.pesa.se/files/pidgin-otr-3.1.0.patch</code></p></blockquote>
</li>
<li>Before you apply the patch, you might want to backup the original file<br />
<blockquote><p><code>$ cp gtk-dialog.c gtk-dialog.c.bak</code></p></blockquote>
</li>
<li>Apply the patch<br />
<blockquote><p><code>$ patch -p0 &lt; pidgin-otr-3.1.0.patch</code></p></blockquote>
</li>
<li>Finally, compile and install it<br />
<blockquote><p><code>$ make &amp;&amp; sudo make install</code></p></blockquote>
</li>
</ol>
<p>And you&#8217;re done!<br />
Happy private messaging in cyberspace :)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pesa.se/2007/09/25/goodbye-big-bloated-otr-button/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
