<?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>mntnoe.com</title>
	<atom:link href="http://www.mntnoe.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mntnoe.com</link>
	<description>Tips and tweaks making you more efficient with your favorite Linux tools.</description>
	<lastBuildDate>Sun, 16 May 2010 17:16:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>XMonad config (May 2010)</title>
		<link>http://www.mntnoe.com/2010/05/xmonad-config-may-2010/</link>
		<comments>http://www.mntnoe.com/2010/05/xmonad-config-may-2010/#comments</comments>
		<pubDate>Sun, 16 May 2010 16:30:59 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[Window Managers]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=150</guid>
		<description><![CDATA[I think it&#8217;s about time I post my updated XMonad configuration. This version does not require any patches, at XMonad 0.9 supports modular configurations natively.

New highlights:

The application pager now uses icons
Per application configuration.
Minimize windows by using special workspaces

Note that I have converted my Colemak key bindings to Qwerty to give an idea of the placement [...]


Related posts:<ol><li><a href='http://www.mntnoe.com/2009/07/xmonad-config-july-2009/' rel='bookmark' title='Permanent Link: XMonad config (July 2009)'>XMonad config (July 2009)</a></li>
<li><a href='http://www.mntnoe.com/2008/08/fvwm-config-of-august-2008/' rel='bookmark' title='Permanent Link: Fvwm config of August 2008'>Fvwm config of August 2008</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I think it&#8217;s about time I post my updated XMonad configuration. This version does not require any patches, at XMonad 0.9 supports modular configurations natively.</p>
<p><a href="http://www.mntnoe.com/wp-content/uploads/2010/04/screenshot-2010-04-25.png"><img class="aligncenter size-medium wp-image-137" title="screenshot-2010-04-25" src="http://www.mntnoe.com/wp-content/uploads/2010/04/screenshot-2010-04-25-300x225.png" alt="" width="300" height="225" /></a></p>
<p><strong>New highlights:</strong></p>
<ul>
<li>The application pager now uses <strong>icons</strong></li>
<li><strong>Per application</strong> configuration.</li>
<li><strong>Minimize</strong> windows by using special workspaces</li>
</ul>
<p>Note that I have converted my Colemak key bindings to Qwerty to give an idea of the placement I use. Also note that this work is not finished. There are still lot of things I want to behave differently, and I need to do some cleanup here and there.</p>
<p>Still, I hope you can get inspired by some of my ideas. Enjoy <img src='http://www.mntnoe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<ul>
<li><a href="/wp-content/uploads/2010/05/xmonad-mntnoe-2010-05-16.tar.bz2">Whole config (incl. icons)</a></li>
</ul>
<ul>
<li><a href="/wp-content/uploads/2010/05/xmonad.hs">xmonad.hs</a> (<a href="/wp-content/uploads/2010/05/xmonad.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/App.hs">App.hs</a> (<a href="/wp-content/uploads/2010/05/App.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/BorderColors.hs">BorderColors.hs</a> (<a href="/wp-content/uploads/2010/05/BorderColors.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/Commands.hs">Commands.hs</a> (<a href="/wp-content/uploads/2010/05/Commands.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/Config.hs">Config.hs</a> (<a href="/wp-content/uploads/2010/05/Config.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/DMenu.hs">DMenu.hs</a> (<a href="/wp-content/uploads/2010/05/DMenu.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/IM.hs">IM.hs</a></li>
<li><a href="/wp-content/uploads/2010/05/Layout.hs">Layout.hs</a> (<a href="/wp-content/uploads/2010/05/Layout.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/MyApps.hs">MyApps.hs</a> (<a href="/wp-content/uploads/2010/05/MyApps.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/Pager.hs">Pager.hs</a> (<a href="/wp-content/uploads/2010/05/Pager.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/Panel.hs">Panel.hs</a> (<a href="/wp-content/uploads/2010/05/Panel.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/Utils.hs">Utils.hs</a> (<a href="/wp-content/uploads/2010/05/Utils.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2010/05/Workspace.hs">Workspace.hs</a> (<a href="/wp-content/uploads/2010/05/Workspace.hs.html">html</a>)</li>
</ul>


<p>Related posts:<ol><li><a href='http://www.mntnoe.com/2009/07/xmonad-config-july-2009/' rel='bookmark' title='Permanent Link: XMonad config (July 2009)'>XMonad config (July 2009)</a></li>
<li><a href='http://www.mntnoe.com/2008/08/fvwm-config-of-august-2008/' rel='bookmark' title='Permanent Link: Fvwm config of August 2008'>Fvwm config of August 2008</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2010/05/xmonad-config-may-2010/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Fast access to web applications</title>
		<link>http://www.mntnoe.com/2010/04/fast-access-to-web-applications/</link>
		<comments>http://www.mntnoe.com/2010/04/fast-access-to-web-applications/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 13:01:22 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[Other Tips]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[keyconfig]]></category>
		<category><![CDATA[prism]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=128</guid>
		<description><![CDATA[Using Keyconfig
If you use many web applications like GMail and Remember the Milk, you may want to get access to them using a single key binding. In Firefox you can use the following snippet together with the Keyconfig extension to

cycle between all tabs matching the regular expression re
if no tab matches, open a new tab [...]


Related posts:<ol><li><a href='http://www.mntnoe.com/2010/02/being-productive-in-gmail-using-itsalltext/' rel='bookmark' title='Permanent Link: Being productive in GMail using ItsAllText'>Being productive in GMail using ItsAllText</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h2>Using Keyconfig</h2>
<p>If you use many web applications like GMail and Remember the Milk, you may want to get access to them using a single key binding. In Firefox you can use the following snippet together with the <a href="http://kb.mozillazine.org/Keyconfig_extension">Keyconfig</a> extension to</p>
<ul>
<li>cycle between all tabs matching the regular expression <em>re</em></li>
<li>if no tab matches, open a new tab showing <em>url</em></li>
</ul>
<pre>function openOrCycle(url, re) {
    var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
        .getService(Components.interfaces.nsIWindowMediator);
    var browserEnumerator = wm.getEnumerator("navigator:browser");

    // Check each browser instance for our URL
    var found = false;
    while (!found &amp;&amp; browserEnumerator.hasMoreElements()) {
        var browserWin = browserEnumerator.getNext();
        var tabbrowser = browserWin.gBrowser;

<span id="more-128"></span>        // Check each tab of this browser instance
        var numTabs = tabbrowser.browsers.length;
        var currentIndex = tabbrowser.tabContainer.selectedIndex;
        var nextIndex = (currentIndex + 1) % numTabs;
        for (var index = nextIndex;
             index != currentIndex;
             index = (index + 1) % numTabs) {
            var currentBrowser = tabbrowser.getBrowserAtIndex(index);
            if (re.test(currentBrowser.currentURI.spec)) {

                // The URL is already opened. Select this tab.
                tabbrowser.selectedTab = tabbrowser
                    .tabContainer
                    .childNodes[index];

                // Focus *this* browser-window
                browserWin.focus();

                found = true;
                break;
            }
        }
    }

    if (!found &amp;&amp;
        re.test(tabbrowser
            .getBrowserAtIndex(currentIndex)
            .currentURI.spec)) {

        // The URL is already opened. Select this tab.
        tabbrowser.selectedTab = tabbrowser
            .tabContainer
            .childNodes[currentIndex];

        // Focus *this* browser-window
        browserWin.focus();
        found = true;
    }

    // Our URL isn't open. Open it now.
    if (!found) {
        var recentWindow = wm.getMostRecentWindow("navigator:browser");
        if (recentWindow) {
            // Use an existing browser window
            if (window._content.document.location.href == "about:blank") {
                window._content.document.location.href = url;
                window._content.focus();
            } else {
                recentWindow.delayedOpenTab(url, null, null, null, null);
            }
        }
        else {
            // No browser windows are open, so open a new one.
            window.open(url);
        }
    }
}

openOrCycle("https://mail.google.com/mail/#inbox",
            /https?:\/\/mail\.google\.com/);</pre>
<p>The snippet is based on examples from <a href="https://developer.mozilla.org/en/Code_snippets/Tabbed_browser">MDC</a>.</p>
<h2>Using Xmonad and Prism</h2>
<p>If you use Xmonad and want very fast access to tasks like sending a mail, checking your calendar or marking a todo-item as completed, you may consider using <a href="http://prism.mozillalabs.com/">Prism</a>. You can assign a key binding in Xmonad to bring focus to a given Prism window – check out the <a href="http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-WindowGo.html">WindowGo</a> and <a href="http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Util-NamedScratchpad.html">NamedScratchpad</a> modules.</p>
<p>Unfortunately the only thing distinguishing Prism windows  is the window title, so we need to force the title to stay fixed using a Greasemonkey script. You will need Teramako&#8217;s <a href="http://github.com/teramako/greasemonkey-for-prism">Greasemonkey build for Prism</a> to do this, and something like the following:</p>
<pre>// ==UserScript==
// @name           title-gmail
// @namespace      mntnoe.com
// @include        *
// ==/UserScript==

document.title="Gmail";
</pre>
<p>Note that some web applications will update the title dynamically, so you may need to adjust your predicate to account for that. For instance, GMail will update the title to &#8220;Gmail &#8211; Inbox (3) &#8211; foo@gmail.com&#8221;, so our predicate will read</p>
<pre>className =? "Prism" &lt;&amp;&amp;&gt; fmap ("Gmail" `isPrefixOf`) title
</pre>
<p>It is a hack, but it works quite well <img src='http://www.mntnoe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>My complete solution is based on NamedScratchpad and makes sure that only one Prism window is shown at a time, enabling you to switch fast between web applications. I will post it together with my current Xmonad setup when I get time.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 1193px; width: 1px; height: 1px;">http://github.com/teramako/greasemonkey-for-prism</div>


<p>Related posts:<ol><li><a href='http://www.mntnoe.com/2010/02/being-productive-in-gmail-using-itsalltext/' rel='bookmark' title='Permanent Link: Being productive in GMail using ItsAllText'>Being productive in GMail using ItsAllText</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2010/04/fast-access-to-web-applications/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Workaround for handling application/octet-streams in Firefox</title>
		<link>http://www.mntnoe.com/2010/02/workaround-for-handling-applicationoctet-streams-in-firefox/</link>
		<comments>http://www.mntnoe.com/2010/02/workaround-for-handling-applicationoctet-streams-in-firefox/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 15:29:16 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[Other Tips]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=118</guid>
		<description><![CDATA[Many sites (for instance aula.au.dk) sends binary files using the application/octet-stream mime type. This is annoying for Firefox users, as they presented with a dialog asking Would you like to save this file? instead of showing the standard dialog offering both the options Open with and Save file.
Bug 327323 has a patch that uses gvfs [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Many sites (for instance <a href="http://aula.au.dk">aula.au.dk</a>) sends binary files using the <em>application/octet-stream</em> mime type. This is annoying for Firefox users, as they presented with a dialog asking <em>Would you like to save this file?</em> instead of showing the standard dialog offering both the options <em>Open with</em> and <em>Save file</em>.</p>
<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=327323">Bug 327323</a> has a patch that uses gvfs to determine the mime type from the extension if Firefox cannot determine it itself. However, if you can&#8217;t wait for that fix to reach your distributions package repository, here is a <a href="http://www.mntnoe.com/wp-content/uploads/2010/02/xulrunner-1.9.1.6-fix-octet-stream-restriction.patch">patch</a> for Firefox 3.5 that bypasses the security restriction for octet-streams and executables. Note that it won&#8217;t remember the application you specify to handle the file, but your can circumvent that by using the <a href="https://addons.mozilla.org/en-US/firefox/addon/207">OpenDownload</a> add-on, which uses your native mime system to look up the default application.</p>
<p><strong>Edit:</strong> I found out that OpenDownload also alters the security restricted download dialog, so you can suffice to install OpenDownload if you want to avoid patching Firefox. You will only be able to open the file with your OS&#8217; default handler, though.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2010/02/workaround-for-handling-applicationoctet-streams-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Being productive in GMail using ItsAllText</title>
		<link>http://www.mntnoe.com/2010/02/being-productive-in-gmail-using-itsalltext/</link>
		<comments>http://www.mntnoe.com/2010/02/being-productive-in-gmail-using-itsalltext/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 19:28:43 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[Other Tips]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=108</guid>
		<description><![CDATA[GMail has a nice keyboard accelerated web interface making it competitive to desktop mail clients as Thunderbird and even Mutt. One reason I stayed with Mutt for a long time was the ability to integrate with Vim. I switched to GMail&#8217;s web interface for other reasons, but nevertheless it was delightful to discover ItsAllText; a [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>GMail has a nice keyboard accelerated web interface making it competitive to desktop mail clients as Thunderbird and even Mutt. One reason I stayed with Mutt for a long time was the ability to integrate with Vim. I switched to GMail&#8217;s web interface for other reasons, but nevertheless it was delightful to discover <a href="https://addons.mozilla.org/en-US/firefox/addon/4125">ItsAllText</a>; a Firefox add-on that allows you to edit any <em>textarea</em> in an external editor.<span id="more-108"></span></p>
<p>You can make Vim automatically activate the <em>mail</em> file type plugin when edit a GMail message by adding the following to ~/.vimrc:</p>
<pre>autocmd BufRead   mail.google.com.* setlocal ft=mail</pre>
<p>Further customization go in ~/.vim/ftplugin/mail.vim:</p>
<pre>setl textwidth=68
call IMAP("sig1","&lt;++&gt;Med venlig hilsen,\nMads...","mail")
call IMAP("sig2","&lt;++&gt;Regards,\nMads...","mail")</pre>
<p>Wrapping your text makes your mail appear more readable and professional, as the line width does not depend on the width of the receivers window. Remember that GMail automatically wraps text at the 72th column, so be sure that <em>textwidth</em> is lesser than that if you set it. The <em>IMAP</em> lines uses <a href="http://vim-latex.svn.sourceforge.net/viewvc/vim-latex/trunk/vimfiles/plugin/imaps.vim?revision=HEAD">imaps</a> to provide an easy way to handle multiple signatures. The <em>&lt;++&gt;</em> thing indicates where to put the cursor; see the comments in imaps.vim for further info.</p>
<p>Likewise, you can set up Vim to use special syntax highlighting on wiki pages that are edited as plain text. This is great when working with for instance <a href="http://www.vim.org/scripts/script.php?script_id=1113">twiki</a> pages on Trac.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2010/02/being-productive-in-gmail-using-itsalltext/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mntnoe.com retouched – and now with key bindings&#8230;</title>
		<link>http://www.mntnoe.com/2010/02/mntnoe-com-retouched/</link>
		<comments>http://www.mntnoe.com/2010/02/mntnoe-com-retouched/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 01:28:54 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=102</guid>
		<description><![CDATA[As you can see I have polished my blog a little, and added a very important feature: A blog focusing this much on key bindings must naturally have keybindings. Using this plugin, you can now zap back and forth between posts by pressing Shift-Left and Shift-Right – useful huh?  
By the way, see Vito [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>As you can see I have polished my blog a little, and added a very important feature: A blog focusing this much on key bindings must naturally have keybindings. Using <a href="http://wordpress.org/extend/plugins/keyboard-navigation">this plugin</a>, you can now zap back and forth between posts by pressing <em>Shift-Left</em> and <em>Shift-Right</em> – useful huh? <img src='http://www.mntnoe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>By the way, see Vito Chin&#8217;s article about <a href="http://techportal.ibuildings.com/2009/07/02/keyboard-enabling-web-applications/">Keyboard Enabling Web Applications</a>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2010/02/mntnoe-com-retouched/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Key bindings in GTK applications</title>
		<link>http://www.mntnoe.com/2010/02/keybindings-in-gtk-applications/</link>
		<comments>http://www.mntnoe.com/2010/02/keybindings-in-gtk-applications/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 23:53:57 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[Key Bindings]]></category>
		<category><![CDATA[gtk]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=80</guid>
		<description><![CDATA[Wouldn&#8217;t it be nice if you could navigate through your application&#8217;s menus using vi-like bindings? You can! Simply something like this in your ~/.gtkrc-2.0 file:
binding "gtk-binding-menu" {
    bind "j" { "move-current" (next) }
    bind "k" { "move-current" (prev) }
    bind "h" { "move-current" (parent) }
  [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Wouldn&#8217;t it be nice if you could navigate through your application&#8217;s menus using <em>vi</em>-like bindings? You can! Simply something like this in your<em> ~/.gtkrc-2.0</em> file:</p>
<pre>binding "gtk-binding-menu" {
    bind "j" { "move-current" (next) }
    bind "k" { "move-current" (prev) }
    bind "h" { "move-current" (parent) }
    bind "l" { "move-current" (child) }
}
class "GtkMenuShell" binding "gtk-binding-menu"</pre>
<p>Keybindings for other GTK widgets can be defined in a similar way. What about moving focus between widgets in the direction they appear?<span id="more-80"></span></p>
<pre>binding "gtk-binding-widget" {
    bind "j" { "move-focus" (up) }
    bind "k" { "move-focus" (down) }
    bind "h" { "move-focus" (left) }
    bind "l" { "move-focus" (right) }
    bind "m" { "popup-menu" () }
}
class "GtkWidget" binding "gtk-binding-widget"</pre>
<p>The <em>m</em> binding lets you pop up the context menu in any widget that not steal the modifier-less keystrokes for text input. For such widgets, prepend a modifier:</p>
<pre>    bind "&lt;mod4&gt;m" { "popup-menu" () }</pre>
<p>Likewise, the <em>move-focus</em> bindings must also be prepended with a modifier if you want to navigate through text fields.</p>
<h2>More examples</h2>
<p>Of course you can&#8217;t use modal editing for text fields, but the following makes it possible to make small corrections without moving your hands to the arrow keys:</p>
<pre>binding "gtk-binding-text" {
    bind "&lt;mod3&gt;j"         { "move-cursor" (display-lines, 1, 0) }
    bind "&lt;mod3&gt;&lt;shift&gt;j"  { "move-cursor" (display-lines, 1, 1) }
    bind "&lt;mod3&gt;k"         { "move-cursor" (display-lines, -1, 0) }
    bind "&lt;mod3&gt;&lt;shift&gt;k"  { "move-cursor" (display-lines, -1, 1) }
    bind "&lt;mod3&gt;l"         { "move-cursor" (logical-positions, 1, 0) }
    bind "&lt;mod3&gt;&lt;shift&gt;i"  { "move-cursor" (logical-positions, 1, 1) }
    bind "&lt;mod3&gt;h"         { "move-cursor" (logical-positions, -1, 0) }
    bind "&lt;mod3&gt;&lt;shift&gt;h"  { "move-cursor" (logical-positions, -1, 1) }
    bind "&lt;mod3&gt;g"         { "move-cursor" (buffer-ends, -1, 0) }
    bind "&lt;mod3&gt;&lt;shift&gt;g"  { "move-cursor" (buffer-ends, -1, 1) }
    bind "&lt;mod3&gt;y"         { "move-cursor" (buffer-ends, 1, 0) }
    bind "&lt;mod3&gt;&lt;shift&gt;y"  { "move-cursor" (buffer-ends, 1, 1) }
    bind "&lt;mod3&gt;u"         { "move-cursor" (words, 1, 0) }
    bind "&lt;mod3&gt;&lt;shift&gt;u"  { "move-cursor" (words, 1, 1) }
    bind "&lt;mod3&gt;o"         { "move-cursor" (words, -1, 0) }
    bind "&lt;mod3&gt;&lt;shift&gt;o"  { "move-cursor" (words, -1, 1) }

    # Xahlee'ish deletion
    bind "&lt;mod3&gt;d"         { "delete-from-cursor" (chars, -1) }
    bind "&lt;mod3&gt;f"         { "delete-from-cursor" (chars, 1) }
    bind "&lt;mod3&gt;e"         { "delete-from-cursor" (word-ends, -1) }
    bind "&lt;mod3&gt;r"         { "delete-from-cursor" (word-ends, 1) }
    bind "&lt;mod3&gt;s"         { "delete-from-cursor" (paragraph-ends, -1) }
    bind "&lt;mod3&gt;g"         { "delete-from-cursor" (paragraph-ends, 1) }

    # Emacs'ish deletion
    bind "&lt;alt&gt;BackSpace"  { "delete-from-cursor" (word-ends, -1) }
}
class "GtkEntry" binding "gtk-binding-text"
class "GtkTextView" binding "gtk-binding-text"</pre>
<p>This one is my favorite and works  neatly in <em>nautilus</em> if you set the default view to <em>list view</em>:</p>
<pre>binding "gtk-binding-tree-view" {
    bind "j"        { "move-cursor" (display-lines, 1) }
    bind "&lt;shift&gt;j" { "move-cursor" (display-lines, 1) }
    bind "k"        { "move-cursor" (display-lines, -1) }
    bind "&lt;shift&gt;k" { "move-cursor" (display-lines, -1) }
    bind "h"        { "move-cursor" (logical-positions, -1) }
    bind "&lt;shift&gt;h" { "move-cursor" (logical-positions, -1) }
    bind "l"        { "move-cursor" (logical-positions, 1) }
    bind "&lt;shift&gt;l" { "move-cursor" (logical-positions, 1) }
    bind "o"        { "move-cursor" (pages, 1) }
    bind "&lt;shift&gt;o" { "move-cursor" (pages, 1) }
    bind "u"        { "move-cursor" (pages, -1) }
    bind "&lt;shift&gt;u" { "move-cursor" (pages, -1) }
    bind "g"        { "move-cursor" (buffer-ends, -1) }
    bind "&lt;shift&gt;g" { "move-cursor" (buffer-ends, -1) }
    bind "y"        { "move-cursor" (buffer-ends, 1) }
    bind "&lt;shift&gt;y" { "move-cursor" (buffer-ends, 1) }
    bind "p"        { "select-cursor-parent" () }
    bind "i"        { "expand-collapse-cursor-row" (0,0,0) }
    bind "semicolon"        { "expand-collapse-cursor-row" (0,1,0) }
    bind "&lt;shift&gt;semicolon" { "expand-collapse-cursor-row" (0,1,1) }
    bind "slash"    { "start-interactive-search" () }
}
class "GtkTreeView" binding "gtk-binding-tree-view"</pre>
<p>Note that you can&#8217;t use the keys you redefine to autostart interactive search any more &#8212; you have to start it manually, in this case by using slash (/). However, I find it faster to navigate this way. Redefine the rest of the alphanummeric keys to some dummy action if you get disturbed by the interactive search when you accidently hit one of the keys not redefined.</p>
<p>You could also experiment with<em> GtkPaned</em>,  <em>GtkNotebook</em>, <em>GtkScrolledWindow</em> and <em>GtkIconView</em>:</p>
<pre>binding "gtk-binding-paned" {
    bind "&lt;mod4&gt;s" { "cycle-child-focus" (0) }
    bind "&lt;mod4&gt;&lt;shift&gt;s" { "cycle-child-focus" (1) }
}
class "GtkPaned" binding "gtk-binding-paned"</pre>
<pre>binding "gtk-binding-notebook" {
    bind "&lt;mod4&gt;d" { "change-current-page" (-1) }
    bind "&lt;mod4&gt;f" { "change-current-page" (1) }
}
class "GtkNotebook" binding "gtk-binding-notebook"</pre>
<pre>binding "gtk-binding-scrolled-window" {
    bind "&lt;mod4&gt;j" { "scroll-child" (step-down, 0) }
    bind "&lt;mod4&gt;k" { "scroll-child" (step-up, 0) }
    bind "&lt;mod4&gt;h" { "scroll-child" (step-left, 0) }
    bind "&lt;mod4&gt;l" { "scroll-child" (step-right, 0) }
    bind "&lt;mod4&gt;o" { "scroll-child" (page-down, 0) }
    bind "&lt;mod4&gt;u" { "scroll-child" (page-up, 0) }
    bind "&lt;mod4&gt;g" { "scroll-child" (start, 0) }
    bind "&lt;mod4&gt;y" { "scroll-child" (end, 0) }
}
class "GtkScrolledWindow" binding "gtk-binding-scrolled-window"</pre>
<pre>binding "gtk-binding-icon-view" {
    bind "j"        { "move-cursor" (display-lines, 1) }
    bind "&lt;shift&gt;j" { "move-cursor" (display-lines, 1) }
    bind "k"        { "move-cursor" (display-lines, -1) }
    bind "&lt;shift&gt;k" { "move-cursor" (display-lines, -1) }
    bind "h"        { "move-cursor" (logical-positions, -1) }
    bind "&lt;shift&gt;h" { "move-cursor" (logical-positions, -1) }
    bind "l"        { "move-cursor" (logical-positions, 1) }
    bind "&lt;shift&gt;l" { "move-cursor" (logical-positions, 1) }
    bind "o"        { "move-cursor" (pages, 1) }
    bind "&lt;shift&gt;o" { "move-cursor" (pages, 1) }
    bind "u"        { "move-cursor" (pages, -1) }
    bind "&lt;shift&gt;u" { "move-cursor" (pages, -1) }
    bind "g"        { "move-cursor" (buffer-ends, -1) }
    bind "&lt;shift&gt;g" { "move-cursor" (buffer-ends, -1) }
    bind "y"        { "move-cursor" (buffer-ends, 1) }
    bind "&lt;shift&gt;y" { "move-cursor" (buffer-ends, 1) }
}
class "GtkIconView" binding "gtk-binding-icon-view"</pre>
<p>Note that the bindings does not work everywhere. For instance, <em>nautilus</em> does not use <em>GtkIconView</em> for the <em>icon view</em>, nor <em>GtkNotebook</em> for tabs, so you must use the <em>list view </em>to use bindings to navigate between files, as well as use nautilus&#8217; own tab bindings  (which can be configured with <em>gtk</em>-<em>can</em>-<em>change</em>-<em>accels</em>).</p>
<h2>Further information</h2>
<p>The best place to get further information on customizing GTK application is the API. It describes the <a href="http://library.gnome.org/devel/gtk/unstable/gtk-Resource-Files.html">syntax</a> for <em>.gtkrc</em>, and the actions available for each <a href="http://library.gnome.org/devel/gtk/unstable/gtkobjects.html">widget</a>. The actions available are the signals with the label &#8220;action&#8221;. Also see <a href="http://library.gnome.org/devel/gtk/unstable/GtkSettings.html#GtkSettings.properties">GtkSettings</a> for miscellaneous settings that affects application behavior.</p>
<p>Finally it should be noted that the layout of bindings in this post serve as example only. It is not the layout that I actually use, as I have lots other bindings competing for the available key combinations <img src='http://www.mntnoe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2010/02/keybindings-in-gtk-applications/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Scancode mapping in Windows XP</title>
		<link>http://www.mntnoe.com/2009/12/scancode-mapping-in-windows-xp/</link>
		<comments>http://www.mntnoe.com/2009/12/scancode-mapping-in-windows-xp/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 15:35:06 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[Key Bindings]]></category>
		<category><![CDATA[windows xp]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=71</guid>
		<description><![CDATA[When using Windows XP at work, I have customized the keyboard layout to almost match my setup on Gentoo &#8212; important when you code lines and lines of Java&#8230;
In addition to my modified Colemak keyboard layout created by the Microsoft Keyboard Layout Creater, I use scancodes to remap special keys, which is not possible in [...]


Related posts:<ol><li><a href='http://www.mntnoe.com/2008/06/english-keyboard-layout-with-danish-characters/' rel='bookmark' title='Permanent Link: English keyboard layout with Danish characters'>English keyboard layout with Danish characters</a></li>
<li><a href='http://www.mntnoe.com/2008/09/danish-vim-friendy-colemak-layout/' rel='bookmark' title='Permanent Link: &#8220;Danish&#8221; Vim-friendy Colemak Layout'>&#8220;Danish&#8221; Vim-friendy Colemak Layout</a></li>
<li><a href='http://www.mntnoe.com/2007/10/mice-are-for-cats/' rel='bookmark' title='Permanent Link: Mice are for cats&#8230;'>Mice are for cats&#8230;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When using Windows XP at work, I have customized the keyboard layout to almost match my setup on Gentoo &#8212; important when you code lines and lines of Java&#8230;</p>
<p>In addition to my modified Colemak keyboard layout created by the <a href="http://www.microsoft.com/globaldev/outreach/dnloads/msklc.mspx">Microsoft Keyboard Layout Creater</a>, I use scancodes to remap special keys, which is not possible in MKLC.</p>
<p>My current setup is this:</p>
<pre>Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,08,00,00,00,01,00,3a,00,3a,00,01,00,19,00,46,00,0e,00,19,00,2a,00,56,00,38,00,38,e0,38,e0,2a,00,00,00,00,00</pre>
<p><em>Note: Be careful when pasting stuff like this into your registry &#8212; you have been warned <img src='http://www.mntnoe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </em></p>
<p>The scancode mapping does the following:</p>
<ul>
<li>Swaps <em>Escape</em> and <em>Caps Lock.</em></li>
<li>Makes QWERTY <em>P</em> an extra <em>Backspace</em> key.<br />
Remember, Colemak has the semicolon on QWERTY P&#8217;s position. This makes it possible to delete</li>
<li>Makes <em>P</em> available on <em>Scroll Lock</em>.<br />
A pragmatic backup key for P when using other layouts than Colemak. For instance, some virtual machines read raw input from the keyboard, but the scancode map still applies.</li>
<li>Moves <em>Left Shift</em> to <em>Less Than</em> (at the right of <em>Left Shift</em> on pc-105 keyboards).<br />
This eases the strain on the left little finger.</li>
<li>Copies <em>Left Alt</em> to <em>Alt-Gr.<br />
</em>This way, you can use both hands for the Alt modifier, which greatly reduces the strain on the hands. Generally, <strong>use the one hand for the key and the other hand for the modifier</strong>.</li>
<li>Moves <em>Alt-Gr</em> to the original position of <em>Left Shift.<br />
</em>Takes a little to get used to, but very handy when defining custom keybindings.</li>
</ul>
<p>The format of the scancode map is pretty simple:</p>
<pre>00,00,00,00, &lt;- preamble
00,00,00,00,
08,00,00,00, &lt;- number of remaining 4-tuples (end-sequence inclusive)
01,00,3a,00, &lt;- swap Escape and Caps Lock
3a,00,01,00,
...
00,00,00,00  &lt;- end-sequence</pre>
<p>You can find more information on the scancode map format <a href="http://www.microsoft.com/whdc/archive/w2kscan-map.mspx">here</a>, and a scan code reference <a href="http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc">here</a>. Have fun&#8230;</p>


<p>Related posts:<ol><li><a href='http://www.mntnoe.com/2008/06/english-keyboard-layout-with-danish-characters/' rel='bookmark' title='Permanent Link: English keyboard layout with Danish characters'>English keyboard layout with Danish characters</a></li>
<li><a href='http://www.mntnoe.com/2008/09/danish-vim-friendy-colemak-layout/' rel='bookmark' title='Permanent Link: &#8220;Danish&#8221; Vim-friendy Colemak Layout'>&#8220;Danish&#8221; Vim-friendy Colemak Layout</a></li>
<li><a href='http://www.mntnoe.com/2007/10/mice-are-for-cats/' rel='bookmark' title='Permanent Link: Mice are for cats&#8230;'>Mice are for cats&#8230;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2009/12/scancode-mapping-in-windows-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rival blog</title>
		<link>http://www.mntnoe.com/2009/11/rival-blog/</link>
		<comments>http://www.mntnoe.com/2009/11/rival-blog/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 00:34:50 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=59</guid>
		<description><![CDATA[My just-as-tool-minded friend has created a blog at esbena.blogspot.com, which you might be interested in. He has some nice setup for Emacs and Eclipse, and is the creator of screencast-mode. Oh, and getting a new rival blog made me put myself together and update my blog  


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>My just-as-tool-minded friend has created a blog at <a href="http://esbena.blogspot.com">esbena.blogspot.com</a>, which you might be interested in. He has some nice setup for Emacs and Eclipse, and is the creator of <a href="http://www.youtube.com/user/esbenandreasen">screencast-mode</a>. Oh, and getting a new rival blog made me put myself together and update <em>my</em> blog <img src='http://www.mntnoe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2009/11/rival-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Navigation in Zsh</title>
		<link>http://www.mntnoe.com/2009/11/navigation-in-zsh/</link>
		<comments>http://www.mntnoe.com/2009/11/navigation-in-zsh/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 23:07:55 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[Other Tips]]></category>
		<category><![CDATA[bookmarks]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=53</guid>
		<description><![CDATA[One of the most useful features in Zsh is its support for user-defined widgets. These two commands will greatly speed up your directory navigation in Zsh:
setopt autopushd

go-up () {
cd ..
zle reset-prompt
}; zle -N go-up

go-to-previous () {
popd
zle reset-prompt
}; zle -N go-to-previous

bindkey '^[u' go-up
bindkey '^[p' go-to-previous
Now you can go up one level with Alt-U and go backwards [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>One of the most useful features in Zsh is its support for user-defined widgets. These two commands will greatly speed up your directory navigation in Zsh:</p>
<pre>setopt autopushd

go-up () {
cd ..
zle reset-prompt
}; zle -N go-up

go-to-previous () {
popd
zle reset-prompt
}; zle -N go-to-previous

bindkey '^[u' go-up
bindkey '^[p' go-to-previous</pre>
<p>Now you can go up one level with Alt-U and go backwards in history with Alt-P. Also, this won't clutter your terminal with "cd .." lines, as the prompt line gets automagically updated. Similarly, you can add <em>bookmark</em>-like functionality with something like this:</p>
<pre>typeset -Ag bookmark

bookmark[1]="$HOME/work/project"
bookmark[2]="$HOME/work/project/src/foo/bar"
bookmark[3]="$HOME/work/project/test/foo/bar"
bookmark[4]="..."
bookmark[5]="..."
bookmark[6]="..."
bookmark[7]="..."
bookmark[8]="..."
bookmark[9]="..."
bookmark[0]="..."

go-to-bookmark () {
cd $bookmark[$KEYS[-1]]
zle reset-prompt
}; zle -N go-to-bookmark

bindkey '^[0' go-to-bookmark
bindkey '^[1' go-to-bookmark
bindkey '^[2' go-to-bookmark
bindkey '^[3' go-to-bookmark
bindkey '^[4' go-to-bookmark
bindkey '^[5' go-to-bookmark
bindkey '^[6' go-to-bookmark
bindkey '^[7' go-to-bookmark
bindkey '^[8' go-to-bookmark
bindkey '^[9' go-to-bookmark</pre>
<p>Have fun!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2009/11/navigation-in-zsh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XMonad config (July 2009)</title>
		<link>http://www.mntnoe.com/2009/07/xmonad-config-july-2009/</link>
		<comments>http://www.mntnoe.com/2009/07/xmonad-config-july-2009/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 12:32:08 +0000</pubDate>
		<dc:creator>mntnoe</dc:creator>
				<category><![CDATA[Window Managers]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=52</guid>
		<description><![CDATA[I have been using XMonad for about a year now and have finally put myself together to upload my customizations. Highlights:

Labeled pager addon for DynamicLog
Fast navigation between workspaces
Application specific border colors
Modified Scratchpad using GNU Screen
Host specific settings (layouts and widgets)

To use these modules, you must put them in ~/.xmonad and then reenable support for user [...]


Related posts:<ol><li><a href='http://www.mntnoe.com/2010/05/xmonad-config-may-2010/' rel='bookmark' title='Permanent Link: XMonad config (May 2010)'>XMonad config (May 2010)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I have been using XMonad for about a year now and have finally put myself together to upload my customizations. Highlights:</p>
<ul>
<li>Labeled <strong>pager</strong> addon for DynamicLog</li>
<li>Fast navigation between <strong>workspaces</strong></li>
<li>Application specific <strong>border colors</strong></li>
<li>Modified <strong>Scratchpad</strong> using GNU Screen</li>
<li><strong>Host</strong> specific settings (layouts and widgets)</li>
</ul>
<p>To use these modules, you must put them in <em>~/.xmonad</em> and then reenable support for user modules in your xmonad source. Simply look for a line in <em>Core.hs</em> containing <em>runProces &#8220;ghc&#8221; ["--make", "xmonad.hs" ...]</em> and remove the <em>&#8220;-i&#8221;</em> entry from the list. This switch was unfortunately added to fix a bug on case insensitive file systems. Note that a solution is under development, placing user modules in <em>~/.xmonad/lib</em>, thus solving the issue with case insensitive systems, see <a class="external text" title="http://code.google.com/p/xmonad/issues/detail?id=230" rel="nofollow" href="http://code.google.com/p/xmonad/issues/detail?id=230">issue 230</a>.</p>
<p style="text-align: center;"><a href="/wp-content/uploads/2009/07/xmonad-mntnoe_2009-07-18.png"><img class="aligncenter" src="/wp-content/uploads/2009/07/xmonad-mntnoe_2009-07-18_thumbnail.png" alt="xmonad-mntnoe_2009-07-18" width="200" height="150" /></a></p>
<p>I will try to make some darcs patches for xmonad-contrib if I get time. Until then, I hope you can get inspired by some of my ideas. Enjoy <img src='http://www.mntnoe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<ul>
<li><a href="/wp-content/uploads/2009/07/xmonad.hs">xmonad.hs</a> (<a href="/wp-content/uploads/2009/07/xmonad.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/xmonad_qwerty.hs">xmonad_qwerty.hs</a> (<a href="/wp-content/uploads/2009/07/xmonad_qwerty.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/BorderColors.hs">BorderColors.hs</a> (<a href="/wp-content/uploads/2009/07/BorderColors.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/DMenu.hs">DMenu.hs</a> (<a href="/wp-content/uploads/2009/07/DMenu.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/Dzen.hs">Dzen.hs</a> (<a href="/wp-content/uploads/2009/07/Dzen.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/Layout.hs">Layout.hs</a> (<a href="/wp-content/uploads/2009/07/Layout.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/Obsolete.hs">Obsolete.hs</a> (<a href="/wp-content/uploads/2009/07/Obsolete.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/Pager.hs">Pager.hs</a> (<a href="/wp-content/uploads/2009/07/Pager.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/ScratchpadPrime.hs">ScratchpadPrime.hs</a> (<a href="/wp-content/uploads/2009/07/ScratchpadPrime.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/ServerMode.hs">ServerMode.hs</a> (<a href="/wp-content/uploads/2009/07/ServerMode.hs.html">html</a>)</li>
<li><a href="/wp-content/uploads/2009/07/Util.hs">Util.hs</a> (<a href="/wp-content/uploads/2009/07/Util.hs.html">html</a>)</li>
</ul>


<p>Related posts:<ol><li><a href='http://www.mntnoe.com/2010/05/xmonad-config-may-2010/' rel='bookmark' title='Permanent Link: XMonad config (May 2010)'>XMonad config (May 2010)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.mntnoe.com/2009/07/xmonad-config-july-2009/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
