]> pere.pagekite.me Git - homepage.git/blobdiff - blog/index.rss
Generated.
[homepage.git] / blog / index.rss
index ec82af6dc7b5a6e7663254252f6cac815a7cc6ea..d571a362c260a2ac8bc5e477133670dd120199e4 100644 (file)
@@ -6,6 +6,119 @@
                 <link>http://people.skolelinux.org/pere/blog/</link>
                 <atom:link href="http://people.skolelinux.org/pere/blog/index.rss" rel="self" type="application/rss+xml" />
        
+       <item>
+               <title>A program should be able to open its own files on Linux</title>
+               <link>http://people.skolelinux.org/pere/blog/A_program_should_be_able_to_open_its_own_files_on_Linux.html</link>
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/A_program_should_be_able_to_open_its_own_files_on_Linux.html</guid>
+                <pubDate>Sun, 5 Jun 2016 08:30:00 +0200</pubDate>
+               <description>&lt;p&gt;Many years ago, when koffice was fresh and with few users, I
+decided to test its presentation tool when making the slides for a
+talk I was giving for NUUG on Japhar, a free Java virtual machine.  I
+wrote the first draft of the slides, saved the result and went to bed
+the day before I would give the talk.  The next day I took a plane to
+the location where the meeting should take place, and on the plane I
+started up koffice again to polish the talk a bit, only to discover
+that kpresenter refused to load its own data file.  I cursed a bit and
+started making the slides again from memory, to have something to
+present when I arrived.  I tested that the saved files could be
+loaded, and the day seemed to be rescued.  I continued to polish the
+slides until I suddenly discovered that the saved file could no longer
+be loaded into kpresenter.  In the end I had to rewrite the slides
+three times, condensing the content until the talk became shorter and
+shorter.  After the talk I was able to pinpoint the problem &amp;ndash;
+kpresenter wrote inline images in a way itself could not understand.
+Eventually that bug was fixed and kpresenter ended up being a great
+program to make slides.  The point I&#39;m trying to make is that we
+expect a program to be able to load its own data files, and it is
+embarrassing to its developers if it can&#39;t.&lt;/p&gt;
+
+&lt;p&gt;Did you ever experience a program failing to load its own data
+files from the desktop file browser?  It is not a uncommon problem.  A
+while back I discovered that the screencast recorder
+gtk-recordmydesktop would save an Ogg Theora video file the KDE file
+browser would refuse to open.  No video player claimed to understand
+such file.  I tracked down the cause being &lt;tt&gt;file --mime-type&lt;/tt&gt;
+returning the application/ogg mime type, which no video player I had
+installed listed as a MIME type they would understand.  I asked for
+&lt;a href=&quot;http://bugs.gw.com/view.php?id=382&quot;&gt;file to change its
+behavour&lt;/a&gt; and use the MIME type video/ogg instead.  I also asked
+several video players to add video/ogg to their desktop files, to give
+the file browser an idea what to do about Ogg Theora files.  After a
+while, the desktop file browsers in Debian started to handle the
+output from gtk-recordmydesktop properly.&lt;/p&gt;
+
+&lt;p&gt;But history repeats itself.  A few days ago I tested the music
+system Rosegarden again, and I discovered that the KDE and xfce file
+browsers did not know what to do with the Rosegarden project files
+(*.rg).  I&#39;ve reported &lt;a href=&quot;http://bugs.debian.org/825993&quot;&gt;the
+rosegarden problem to BTS&lt;/a&gt; and a fix is commited to git and will be
+included in the next upload.  To increase the chance of me remembering
+how to fix the problem next time some program fail to load its files
+from the file browser, here are some notes on how to fix it.&lt;/p&gt;
+
+&lt;p&gt;The file browsers in Debian in general operates on MIME types.
+There are two sources for a given files MIME type.  The output from
+&lt;tt&gt;file --mime-type&lt;/tt&gt; mentioned above, and the content of the
+shared MIME type registry (under /usr/share/mime/).  The file mime
+type is mapped to programs supporting the mime type, and this
+information is collected from
+&lt;a href=&quot;https://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/&quot;&gt;the
+desktop files&lt;/a&gt; available in /usr/share/applications/.  If there is
+one desktop file claiming support for the MIME type of the file, it is
+activated when asking to open a given file.  If there are more, one
+can normally select which one to use by right-clicking on the file and
+selecting the wanted one using &#39;Open with&#39; or similar.  In general
+this work well.  But it depend on each program picking a good mime
+type (preferably
+&lt;a href=&quot;http://www.iana.org/assignments/media-types/media-types.xhtml&quot;&gt;a
+MIME type registered with IANA&lt;/a&gt;), file and/or the shared mime
+registry recognizing the file and the desktop file to list the MIME
+type in its list of supported MIME types.&lt;/p&gt;
+
+&lt;p&gt;The &lt;tt&gt;/usr/share/mime/packages/rosegarden.xml&lt;/tt&gt; entry for
+&lt;a href=&quot;http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec&quot;&gt;the
+Shared MIME database&lt;/a&gt; look like this:&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
+&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
+&amp;lt;mime-info xmlns=&quot;http://www.freedesktop.org/standards/shared-mime-info&quot;&amp;gt;
+  &amp;lt;mime-type type=&quot;audio/x-rosegarden&quot;&amp;gt;
+    &amp;lt;sub-class-of type=&quot;application/x-gzip&quot;/&amp;gt;
+    &amp;lt;comment&amp;gt;Rosegarden project file&amp;lt;/comment&amp;gt;
+    &amp;lt;glob pattern=&quot;*.rg&quot;/&amp;gt;
+  &amp;lt;/mime-type&amp;gt;
+&amp;lt;/mime-info&amp;gt;
+&lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;This states that audio/x-rosegarden is a kind of application/x-gzip
+(it is a gzipped XML file).  Note, it is much better to use an
+official MIME type registered with IANA than it is to make up ones own
+unofficial ones like the x-rosegarden type used by rosegarden.&lt;/p&gt;
+
+&lt;p&gt;The desktop file of the rosegarden program failed to list
+audio/x-rosegarden in its list of supported MIME types, causing the
+file browsers to have no idea what to do with *.rg files:&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
+% grep Mime /usr/share/applications/rosegarden.desktop
+MimeType=audio/x-rosegarden-composition;audio/x-rosegarden-device;audio/x-rosegarden-project;audio/x-rosegarden-template;audio/midi;
+X-KDE-NativeMimeType=audio/x-rosegarden-composition
+%
+&lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;The fix was to add &quot;audio/x-rosegarden;&quot; at the end of the
+MimeType= line.&lt;/p&gt;
+
+&lt;p&gt;If you run into a file which fail to open the correct program when
+selected from the file browser, please check out the output from
+&lt;tt&gt;file --mime-type&lt;/tt&gt; for the file, ensure the file ending and
+MIME type is registered somewhere under /usr/share/mime/ and check
+that some desktop file under /usr/share/applications/ is claiming
+support for this MIME type.  If not, please report a bug to have it
+fixed. :)&lt;/p&gt;
+</description>
+       </item>
+       
        <item>
                <title>Tor - from its creators mouth 11 years ago</title>
                <link>http://people.skolelinux.org/pere/blog/Tor___from_its_creators_mouth_11_years_ago.html</link>
@@ -358,50 +471,5 @@ as it must go to stop this kind of DNS hijacking.&lt;/p&gt;
 </description>
        </item>
        
-       <item>
-               <title>Ny utgave (v2.2) av den frie norske stavekontrollen gitt ut</title>
-               <link>http://people.skolelinux.org/pere/blog/Ny_utgave__v2_2__av_den_frie_norske_stavekontrollen_gitt_ut.html</link>
-               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Ny_utgave__v2_2__av_den_frie_norske_stavekontrollen_gitt_ut.html</guid>
-                <pubDate>Fri, 15 Apr 2016 21:20:00 +0200</pubDate>
-               <description>&lt;p&gt;I dag tok jeg mot til meg og pakket sammen en ny versjon av den
-frie norske stavekontrollen, ca. tre og et halvt år etter forrige
-gang.  Resultatet kan lastes ned fra
-&lt;a href=&quot;http://no.speling.org/&quot;&gt;no.speling.org-prosjeksiden&lt;/a&gt;, både
-som kildekodepakke og som &quot;pack&quot;-fil som kanskje fortsatt kan brukes
-av OpenOffice.org/LibreOffice.  Byggesystemet trenger oppussing, men i
-denne omgang hadde jeg bare tid til å fikse byggefeil forårsaket av
-endringer i GNU grep.  De øvrige endringene var gjort tidligere i
-påvente av en ny utgave.&lt;/p&gt;
-
-&lt;p&gt;&lt;strong&gt;Her er det som er nytt (fra NEWS-fila i
-kildekodepakken):&lt;/strong&gt;&lt;/p&gt;
-
-&lt;p&gt;Release 2.2 (2016-04-15)&lt;/p&gt;
-
-&lt;ul&gt;
-
- &lt;li&gt;Rewrite how scripts/speling2words handle tripple consonants, to
-   avoid importing duplicate words from no.speling.org, and getting
-   rid of the existing duplicates in norsk.words.&lt;/li&gt;
- &lt;li&gt;Remove duplicate entries with tripple consonants from norsk.words.&lt;/li&gt;
- &lt;li&gt;Update frequency for entries in norsk.words based on
-   &lt;URL:http://helmer.aksis.uib.no/nta/ordlistf.zip&gt; (ran &#39;make
-   freq-update&#39;).&lt;/li&gt;
- &lt;li&gt;Correct nn ispell build, avoid crash in munchlist causing lots of
-   words to fall out of the database.&lt;/li&gt;
- &lt;li&gt;Use grep -a to convince grep it is working on text files, to work
-   with newer grep versions.&lt;/li&gt;
-
- &lt;li&gt;Remove some words disputed in the no.speling.org review process:
-   &lt;ul&gt;
-    &lt;li&gt;apparent (nb)&lt;/li&gt;
-    &lt;li&gt;likke (nb)&lt;/li&gt;
-    &lt;li&gt;ugjest, ugjesten, ugjestens (nb)&lt;/li&gt;
- &lt;/ul&gt;&lt;/li&gt;
-
-&lt;/ul&gt;
-</description>
-       </item>
-       
         </channel>
 </rss>