<div dir="ltr"><pre><br></pre>
    <b>John Carlyle-Clarke</b> <a style="background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAAXNSR0IArs4c6QAAAahJREFUGNMlwUtrE1EUAOBz5t4MM5kZhqhtVNBaaCAgLjSCrd24ECyCLrQWLCoiSAX/hD9CcOVCRLRFN+JGKLh3JRRTpW2oDyKJyaSTeWXm3jnHhd+HvNgCRKgfGcw22TDgPwKrSL0vn6H7V08SCd0ekIb+oNe60FtY0LYpmMw4PfXxg7u1k2XJWJN4Ml2DJKXhwG9vHTM4bc4XJ4zzb976LzbiKNKaPd9FfeNaOTeTP38ZB2EFwFm6LOtT0fpGqkvH9uwHt2WnY8Sm2L6zbKzdE44dSOhubg5fvR7qsmKb1cd3d1dWkoqUiorRdO3X8qqUrvvsaRxGIwTfMdXDR53VK7kyMS9lRRVeEv2mqjt3tnHzPn56T4XipVvti5dk6pqyZMFS5JQGZH/fPvnjoH/9qt1qqGKiZpqzu929CY2OH2pmSqo0kV/3p6Lxz/nTmWtK/5wWQFA4Xr2+E+zvRWocSNEL2bTaZw5nYgKqYAAkROYBVsuGZf3pU5DL0JLfqqI4iEhrQABGQAYAYGAGQAwdS9aIF9+tExAxo8FMCABoMABwiYx4VPM/s9PX21lOAvoAAAAASUVORK5CYII=) no-repeat scroll left center; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 15px;" href="mailto:portland%40lists.freedesktop.org?Subject=%5BPortland%5D%20xdg-open%20generic_open%28%29%20functionality&amp;In-Reply-To=" title="[Portland] xdg-open generic_open() functionality">jpcc at bigfoot.com
       </a><br>
    <i>Tue Apr 22 17:38:49 PDT 2008</i><br><pre>&gt; Dear all-<br>&gt;<br>&gt; I have some suggestions for improving this.  I found some problems when <br>&gt; using gnome-do under Openbox, since gnome-do uses xdg-open for viewing <br>
&gt; items and in my environment the generic_open gets used.  I&#39;d be willing <br>&gt; to submit patches for review although I am a novice shell programmer.  <br>&gt; However because of my lack of experience I wanted to float the <br>
&gt; suggestions to see if they even hold water.<br>&gt;<br>&gt; (1) generic_open uses run-mailcap.  This is rather limited as it<br>&gt; depends on file extensions.  It would seem better to use file or<br>&gt; probably xdg-mime to choose how to open the file.<br>
&gt;<br>&gt; The mime type could be fetched with:<br>&gt;<br>&gt; file --mime &quot;$1&quot;<br>&gt;<br>&gt; and extracted from the output and prepended to the filename before<br>&gt; passing to run-mailcap.<br>&gt;<br>&gt; However, it looks to me like a better option would be to use xdg-mime,<br>
&gt; since xdg-mime query default &quot;$1&quot; will give you the default application<br>&gt; to open the file.<br>&gt;<br>&gt; (2) The open_generic() function should support file URL&#39;s with encoded<br>&gt; characters, e.g. <a style="background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAACQSURBVHjajJFdCoQgFIUrZnWuQnzQJ7cyCILgnlyRP8OcOnCzCGY%2BKOzcj9ON1lLK8osXLnifiTEG70QptUsy9t5z0HsPIfAMYROJxvugtWatFWlvuvUDSLXWi0QDBUydczBSSszPJoJUDEkepBjj%2FHguLik%2ByhijtZ73u0tcGUjNw%2BtAzlnGBML6z2%2F5CjAAaG0XfCLnE00AAAAASUVORK5CYII%3D) no-repeat scroll left center; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 15px;" href="file://home/user/foo%20bar">file://home/user/foo%20bar</a><br>
&gt;<br>&gt; gnome-open supports this format so it would make sense to try and match <br>&gt; it since the above is a valid URL.  If not, the docs should be updated <br>&gt; to specifically say that this may not be supported by xdg-open,<br>
&gt; depending on the environment.<br>&gt;<br>&gt; (3) Users of Fluxbox, Openbox and other WM&#39;s may have gnome-open or the <br>&gt; corresponding KDE or XFCE components installed and may wish xdg-open to <br>&gt; use them.<br>
&gt; <br>&gt; detectDE() could have code added to check for a variable - say<br>&gt; XDG_OPEN_FORCE_DE - and use that value (kde, gnome, xfce, generic)<br>&gt; instead of attempting a detection if it is present.<br><br><br>
Any news on this?<br>It is really annoying that there&#39;s no good implementation of any generic way of managing mimetype associations. xdg-open is not really an option when you are not using gnome/kde.<br></pre><br>--<br>
Ferk<br></div>