<?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://mntnoe.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mntnoe.com</link>
	<description></description>
	<lastBuildDate>Mon, 12 Sep 2011 07:19:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>mntnoe.com has moved to new servers</title>
		<link>http://mntnoe.com/2011/09/mntnoe-com-has-moved-to-new-servers/</link>
		<comments>http://mntnoe.com/2011/09/mntnoe-com-has-moved-to-new-servers/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 07:19:06 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mntnoe.com/?p=174</guid>
		<description><![CDATA[I have imported the old post for now, and will update the rest of the site when I get time. Thank you for your understanding&#8230; &#8211; Mads &#160;]]></description>
			<content:encoded><![CDATA[<p>I have imported the old post for now, and will update the rest of the site when I get time. Thank you for your understanding&#8230;</p>
<p>&#8211; Mads</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://mntnoe.com/2011/09/mntnoe-com-has-moved-to-new-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs config (August 2011)</title>
		<link>http://mntnoe.com/2011/08/emacs-config-august-2011/</link>
		<comments>http://mntnoe.com/2011/08/emacs-config-august-2011/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 17:55:15 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</dc:creator>
				<category><![CDATA[Editors]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[org-mode]]></category>
		<category><![CDATA[tabbar]]></category>
		<category><![CDATA[viper]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=166</guid>
		<description><![CDATA[In addition to Vim, I use Emacs for things like org-mode and certain functional programming languages. Of course, I have configured it to behave closely like my Vim setup. The keybinding layout works fine using both Qwerty and Colemak (if you swap Y and J). Configuration highlights: Viper Tabbar Org-mode The files are available at [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to Vim, I use Emacs for things like org-mode and certain functional programming languages. Of course, I have configured it to behave closely like my Vim setup. The keybinding layout works fine using both Qwerty and Colemak (if you <a href="http://www.mntnoe.com/2008/09/danish-vim-friendy-colemak-layout/">swap Y and J</a>).</p>
<p><a href="http://www.mntnoe.com/wp-content/uploads/2011/08/screenshot-2011-08-15_18.50.33.png"></a><a href="http://www.mntnoe.com/wp-content/uploads/2011/08/screenshot-2011-08-15_18.50.331.png"><img class="aligncenter size-medium wp-image-168" title="emacs" src="http://www.mntnoe.com/wp-content/uploads/2011/08/screenshot-2011-08-15_18.50.331-273x300.png" alt="" width="273" height="300" /></a></p>
<p>Configuration highlights:</p>
<ul>
<li>Viper</li>
<li>Tabbar</li>
<li>Org-mode</li>
</ul>
<p>The files are available at my <a href="http://github.com/mntnoe/mntnoe-dotfiles/tree/master/.emacs.d" target="_blank">Github repo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mntnoe.com/2011/08/emacs-config-august-2011/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Configuration files now on Github!</title>
		<link>http://mntnoe.com/2011/08/configuration-files-now-on-github/</link>
		<comments>http://mntnoe.com/2011/08/configuration-files-now-on-github/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 17:50:54 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=171</guid>
		<description><![CDATA[Check out my dotfiles repository at: github.com/mntnoe/mntnoe-dotfiles]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mntnoe.com/wp-content/uploads/2011/08/github_logo.png"><img class="size-full wp-image-172 alignright" title="github_logo" src="http://www.mntnoe.com/wp-content/uploads/2011/08/github_logo.png" alt="" width="124" height="55" /></a>Check out my dotfiles repository at:</p>
<p style="text-align: center;"><a href="http://github.com/mntnoe/mntnoe-dotfiles" target="_blank">github.com/mntnoe/mntnoe-dotfiles</a></p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://mntnoe.com/2011/08/configuration-files-now-on-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XMonad config (May 2010)</title>
		<link>http://mntnoe.com/2010/05/xmonad-config-may-2010/</link>
		<comments>http://mntnoe.com/2010/05/xmonad-config-may-2010/#comments</comments>
		<pubDate>Sun, 16 May 2010 16:30:59 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</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 [...]]]></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://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>
]]></content:encoded>
			<wfw:commentRss>http://mntnoe.com/2010/05/xmonad-config-may-2010/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Fast access to web applications</title>
		<link>http://mntnoe.com/2010/04/fast-access-to-web-applications/</link>
		<comments>http://mntnoe.com/2010/04/fast-access-to-web-applications/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 13:01:22 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</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 [...]]]></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://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>
]]></content:encoded>
			<wfw:commentRss>http://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://mntnoe.com/2010/02/workaround-for-handling-applicationoctet-streams-in-firefox/</link>
		<comments>http://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>Mads Navntoft Noe</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 [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://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://mntnoe.com/2010/02/being-productive-in-gmail-using-itsalltext/</link>
		<comments>http://mntnoe.com/2010/02/being-productive-in-gmail-using-itsalltext/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 19:28:43 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</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 [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://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://mntnoe.com/2010/02/mntnoe-com-retouched/</link>
		<comments>http://mntnoe.com/2010/02/mntnoe-com-retouched/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 01:28:54 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</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 Chin&#8217;s [...]]]></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://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>
]]></content:encoded>
			<wfw:commentRss>http://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://mntnoe.com/2010/02/keybindings-in-gtk-applications/</link>
		<comments>http://mntnoe.com/2010/02/keybindings-in-gtk-applications/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 23:53:57 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</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) } bind "l" { "move-current" (child) } } class "GtkMenuShell" [...]]]></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://mntnoe.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mntnoe.com/2010/02/keybindings-in-gtk-applications/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Scancode mapping in Windows XP</title>
		<link>http://mntnoe.com/2009/12/scancode-mapping-in-windows-xp/</link>
		<comments>http://mntnoe.com/2009/12/scancode-mapping-in-windows-xp/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 15:35:06 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</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 [...]]]></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_MACHINESYSTEMCurrentControlSetControlKeyboard 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://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>
]]></content:encoded>
			<wfw:commentRss>http://mntnoe.com/2009/12/scancode-mapping-in-windows-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

