<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Mutt and GNOME MIME types</title>
	<atom:link href="http://therning.org/magnus/archives/251/feed" rel="self" type="application/rss+xml" />
	<link>http://therning.org/magnus/archives/251</link>
	<description>Incoherent mumblings</description>
	<lastBuildDate>Wed, 08 Aug 2012 00:21:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: xim</title>
		<link>http://therning.org/magnus/archives/251/comment-page-1#comment-217279</link>
		<dc:creator>xim</dc:creator>
		<pubDate>Thu, 19 May 2011 01:51:26 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/archives/251#comment-217279</guid>
		<description><![CDATA[&lt;p&gt;I wanted to do this, but noticed that gnomevfs.mime_get_default_application gives you the system default application i.e. it doesn&#039;t respect user preferences set in gnome.&lt;/p&gt;

&lt;p&gt;Solution: gio.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&gt;&gt;&gt; import gio
&gt;&gt;&gt; gfile = gio.File(filename)
&gt;&gt;&gt; gapp = gfile.query_default_handler()
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That gives you the default app. The correct way to use it afterwards may be to use&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&gt;&gt;&gt; gapp.launch_uris([gfile.get_uri()])
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;but I&#039;m not sure if you can make that blocking or not.&lt;/p&gt;

&lt;p&gt;I have, however incorporated it into an old python script that has run-mailcap and then xdg-open as fallbacks. It&#039;s a bit ugly, but solid: https://gist.github.com/979990&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>I wanted to do this, but noticed that gnomevfs.mime_get_default_application gives you the system default application i.e. it doesn&#8217;t respect user preferences set in gnome.</p>

<p>Solution: gio.</p>

<pre><code>&gt;&gt;&gt; import gio
&gt;&gt;&gt; gfile = gio.File(filename)
&gt;&gt;&gt; gapp = gfile.query_default_handler()
</code></pre>

<p>That gives you the default app. The correct way to use it afterwards may be to use</p>

<pre><code>&gt;&gt;&gt; gapp.launch_uris([gfile.get_uri()])
</code></pre>

<p>but I&#8217;m not sure if you can make that blocking or not.</p>

<p>I have, however incorporated it into an old python script that has run-mailcap and then xdg-open as fallbacks. It&#8217;s a bit ugly, but solid: <a href="https://gist.github.com/979990" rel="nofollow">https://gist.github.com/979990</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luca Invernizzi</title>
		<link>http://therning.org/magnus/archives/251/comment-page-1#comment-164431</link>
		<dc:creator>Luca Invernizzi</dc:creator>
		<pubDate>Thu, 11 Dec 2008 15:19:46 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/archives/251#comment-164431</guid>
		<description><![CDATA[&lt;p&gt;It may be a stupid answer, but check if you have xdg-open installed. It uses the same mailcap files, but it does not fork.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>It may be a stupid answer, but check if you have xdg-open installed. It uses the same mailcap files, but it does not fork.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andykirk</title>
		<link>http://therning.org/magnus/archives/251/comment-page-1#comment-77841</link>
		<dc:creator>andykirk</dc:creator>
		<pubDate>Thu, 23 Aug 2007 21:56:21 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/archives/251#comment-77841</guid>
		<description><![CDATA[&lt;p&gt;I hate the way mutt waits for you to finish viewing an attachment. A third option would be for your python script copy the temp file it is given, then spawn the real viewer on the copy and exit.&lt;/p&gt;

&lt;p&gt;Thanks for the code BTW.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>I hate the way mutt waits for you to finish viewing an attachment. A third option would be for your python script copy the temp file it is given, then spawn the real viewer on the copy and exit.</p>

<p>Thanks for the code BTW.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brinal</title>
		<link>http://therning.org/magnus/archives/251/comment-page-1#comment-59995</link>
		<dc:creator>brinal</dc:creator>
		<pubDate>Thu, 07 Jun 2007 21:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/archives/251#comment-59995</guid>
		<description><![CDATA[&lt;p&gt;Thanks a ton. This is &lt;em&gt;nice&lt;/em&gt; !
I simply added some mime-types i didn&#039;t want handled that way before that line and added image/*-types etc and off i go.&lt;/p&gt;

&lt;p&gt;one thing i need to figure out now, is how to open multiple attachements when there tagged as in 2 pdfs at once...&lt;/p&gt;

&lt;p&gt;thanks!
brinal&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Thanks a ton. This is <em>nice</em> !
I simply added some mime-types i didn&#8217;t want handled that way before that line and added image/*-types etc and off i go.</p>

<p>one thing i need to figure out now, is how to open multiple attachements when there tagged as in 2 pdfs at once&#8230;</p>

<p>thanks!
brinal</p>
]]></content:encoded>
	</item>
</channel>
</rss>
