]> pere.pagekite.me Git - homepage.git/blobdiff - blog/index.rss
Generated.
[homepage.git] / blog / index.rss
index 1069d61319c42a69e3b7722c1a92630cc6f102bc..d2c57d67db4fe0b649431cf840ecbde9837d33f1 100644 (file)
@@ -6,6 +6,86 @@
                 <link>https://people.skolelinux.org/pere/blog/</link>
                 <atom:link href="https://people.skolelinux.org/pere/blog/index.rss" rel="self" type="application/rss+xml" />
        
                 <link>https://people.skolelinux.org/pere/blog/</link>
                 <atom:link href="https://people.skolelinux.org/pere/blog/index.rss" rel="self" type="application/rss+xml" />
        
+       <item>
+               <title>Is the desktop recommending your program for opening its files?</title>
+               <link>https://people.skolelinux.org/pere/blog/Is_the_desktop_recommending_your_program_for_opening_its_files_.html</link>
+               <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/Is_the_desktop_recommending_your_program_for_opening_its_files_.html</guid>
+                <pubDate>Sun, 29 Jan 2023 11:00:00 +0100</pubDate>
+               <description>&lt;p&gt;Linux desktop systems
+&lt;a href=&quot;https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html&quot;&gt;have
+standardized&lt;/a&gt; how programs present themselves to the desktop
+system.  If a package include a .desktop file in
+/usr/share/application, Gnome, KDE, LXDE, Xfce and the other desktop
+environments will pick up the file and use its content to generate the
+menu of available programs in the system.  A lesser known fact is that
+a package can also explain to the desktop system how to recognize the
+files created by the program in question, and use it to open these
+files on request, for example via a GUI file browser.&lt;/p&gt;
+
+&lt;p&gt;A while back I ran into a package that did not tell the desktop
+system how to recognize its files and was not used to open its files
+in the file browser and fixed it.  In the process I wrote a simple
+debian/tests/ script to ensure the setup keep working.  It might be
+useful for other packages too, to ensure any future version of the
+package keep handling its own files.&lt;/p&gt;
+
+&lt;p&gt;For this to work the file format need a useful MIME type that can
+be used to identify the format.  If the file format do not yet have a
+MIME type, it should define one and preferably also
+&lt;a href=&quot;https://www.iana.org/assignments/media-types/media-types.xhtml&quot;&gt;register
+it with IANA&lt;/a&gt; to ensure the MIME type string is reserved.&lt;/p&gt;
+
+&lt;p&gt;The script uses the &lt;tt&gt;xdg-mime&lt;/tt&gt; program from xdg-utils to
+query the database of standardized package information and ensure it
+return sensible values.  It also need the location of an example file
+for xdg-mime to guess the format of.&lt;/p&gt;
+
+&lt;pre&gt;
+#!/bin/sh
+#
+# Author: Petter Reinholdtsen
+# License: GPL v2 or later at your choice.
+#
+# Validate the MIME setup, making sure motor types have
+# application/vnd.openmotor+yaml associated with them and is connected
+# to the openmotor desktop file.
+
+retval=0
+
+mimetype=&quot;application/vnd.openmotor+yaml&quot;
+testfile=&quot;test/data/real/o3100/motor.ric&quot;
+mydesktopfile=&quot;openmotor.desktop&quot;
+
+filemime=&quot;$(xdg-mime query filetype &quot;$testfile&quot;)&quot;
+
+if [ &quot;$mimetype&quot; != &quot;$filemime&quot; ] ; then
+    retval=1
+    echo &quot;error: xdg-mime claim motor file MIME type is $filemine, not $mimetype&quot;
+else
+    echo &quot;success: xdg-mime report correct mime type $mimetype for motor file&quot;
+fi
+
+desktop=$(xdg-mime query default &quot;$mimetype&quot;)
+
+if [ &quot;$mydesktopfile&quot; != &quot;$desktop&quot; ]; then
+    retval=1
+    echo &quot;error: xdg-mime claim motor file should be handled by $desktop, not $mydesktopfile&quot;
+else
+    echo &quot;success: xdg-mime agree motor file should be handled by $mydesktopfile&quot;
+fi
+
+exit $retval
+&lt;/pre&gt;
+
+&lt;p&gt;It is a simple way to ensure your users are not very surprised when
+they try to open one of your file formats in their file browser.&lt;/p&gt;
+
+&lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
+activities, please send Bitcoin donations to my address
+&lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
+</description>
+       </item>
+       
        <item>
                <title>Opensnitch, the application level interactive firewall, heading into the Debian archive</title>
                <link>https://people.skolelinux.org/pere/blog/Opensnitch__the_application_level_interactive_firewall__heading_into_the_Debian_archive.html</link>
        <item>
                <title>Opensnitch, the application level interactive firewall, heading into the Debian archive</title>
                <link>https://people.skolelinux.org/pere/blog/Opensnitch__the_application_level_interactive_firewall__heading_into_the_Debian_archive.html</link>
@@ -20,7 +100,7 @@ description of the Little Snitch application for MacOS X.  It seemed
 like a very nice tool to have in the tool box, and I decided to see if
 something similar was available for Linux.&lt;/p&gt;
 
 like a very nice tool to have in the tool box, and I decided to see if
 something similar was available for Linux.&lt;/p&gt;
 
-&lt;p&gt;It did not took long to find
+&lt;p&gt;It did not take long to find
 &lt;a href=&quot;https://github.com/evilsocket/opensnitch&quot;&gt;the OpenSnitch
 package&lt;/a&gt;, which has been in development since 2017, and now is in
 version 1.5.0.  It has had a
 &lt;a href=&quot;https://github.com/evilsocket/opensnitch&quot;&gt;the OpenSnitch
 package&lt;/a&gt;, which has been in development since 2017, and now is in
 version 1.5.0.  It has had a
@@ -573,83 +653,5 @@ minutes my machine had the latest and greatest BIOS firmware in place.&lt;/p&gt;
 </description>
        </item>
        
 </description>
        </item>
        
-       <item>
-               <title>Playing and encoding AV1 in Debian Bullseye</title>
-               <link>https://people.skolelinux.org/pere/blog/Playing_and_encoding_AV1_in_Debian_Bullseye.html</link>
-               <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/Playing_and_encoding_AV1_in_Debian_Bullseye.html</guid>
-                <pubDate>Sat, 16 Apr 2022 08:40:00 +0200</pubDate>
-               <description>&lt;p&gt;Inspired by the recent news of
-&lt;a href=&quot;https://slashdot.org/story/22/04/03/2039219/intel-beats-amd-and-nvidia-with-arc-gpus-full-av1-support&quot;&gt;AV1
-hardware encoding support from Intel&lt;/a&gt;, I decided to look into
-the state of AV1 on Linux today.  AV1 is a
-&lt;a href=&quot;https://web.archive.org/web/20160618103850/http://www.digistan.org/open-standard:definition&quot;&gt;free
-and open standard&lt;/a&gt; as defined by Digistan without any royalty
-payment requirement, unlike its much used competitor encoding
-H.264.  While looking, I came across an 5 year
-&lt;a href=&quot;https://askubuntu.com/questions/1061908/how-to-encode-and-playback-video-with-the-av1-codec-on-bionic-beaver-18-04&quot;&gt;old
-question on askubuntu.com&lt;/a&gt; which in turn inspired me to check out
-how things are in Debian Stable regarding AV1.  The test file listed
-in the question (askubuntu_test_aom.mp4) did not exist any more, so I
-tracked down a different set of test files on
-&lt;a href=&quot;https://av1.webmfiles.org/&quot;&gt;av1.webmfiles.org&lt;/a&gt; to test them
-with the various video tools I had installed on my machine.  I was
-happy to discover that AV1 decoding and playback worked with almost
-every tool I tested:
-
-&lt;table align=&quot;center&quot;&gt;
-&lt;tr&gt;&lt;td&gt;mediainfo&lt;/td&gt;       &lt;td&gt;ok&lt;/td&gt;&lt;/tr&gt;
-&lt;tr&gt;&lt;td&gt;dragonplayer&lt;/td&gt;    &lt;td&gt;ok&lt;/td&gt;&lt;/tr&gt;
-&lt;tr&gt;&lt;td&gt;ffmpeg / ffplay&lt;/td&gt; &lt;td&gt;ok&lt;/td&gt;&lt;/tr&gt;
-&lt;tr&gt;&lt;td&gt;gnome-mplayer&lt;/td&gt;   &lt;td&gt;fail&lt;/td&gt;&lt;/tr&gt;
-&lt;tr&gt;&lt;td&gt;mplayer&lt;/td&gt;              &lt;td&gt;ok&lt;/td&gt;&lt;/tr&gt;
-&lt;tr&gt;&lt;td&gt;mpv&lt;/td&gt;          &lt;td&gt;ok&lt;/td&gt;&lt;/tr&gt;
-&lt;tr&gt;&lt;td&gt;parole&lt;/td&gt;       &lt;td&gt;ok&lt;/td&gt;&lt;/tr&gt;
-&lt;tr&gt;&lt;td&gt;vlc&lt;/td&gt;          &lt;td&gt;ok&lt;/td&gt;&lt;/tr&gt;
-&lt;tr&gt;&lt;td&gt;firefox&lt;/td&gt;         &lt;td&gt;ok&lt;/td&gt;&lt;/tr&gt;
-&lt;tr&gt;&lt;td&gt;chromium&lt;/td&gt;        &lt;td&gt;ok&lt;/td&gt;&lt;/tr&gt;
-&lt;/table&gt;
-
-&lt;p&gt;AV1 encoding is available in Debian Stable from the aom-tools
-version 1.0.0.errata1-3 package, using the aomenc tool.  The encoding
-using the package in Debian Stable is quite slow, with the frame rate
-for my 10 second test video at around 0.25 fps.  My 10 second video
-test took 16 minutes and 11 seconds on my test machine.&lt;/p&gt;
-
-&lt;p&gt;I tested by first running ffmpeg and then aomenc using the recipe
-provided by the askubuntu recipe above.  I had to remove the
-&#39;--row-mt=1&#39; option, as it was not supported in my 1.0.0 version.  The
-encoding only used a single thread, according to &lt;tt&gt;top&lt;/tt&gt;.&lt;/p&gt;
-
-&lt;blockquote&gt;&lt;pre&gt;
-ffmpeg -i some-old-video.ogv -t 10 -pix_fmt yuv420p video.y4m
-aomenc --fps=24/1 -u 0 --codec=av1 --target-bitrate=1000 \
-  --lag-in-frames=25 --auto-alt-ref=1 -t 24 --cpu-used=8 \
-  --tile-columns=2 --tile-rows=2 -o output.webm video.y4m
-&lt;/pre&gt;&lt;/blockquote&gt;
-
-&lt;p&gt;As version 1.0.0 currently have several
-&lt;a href=&quot;https://security-tracker.debian.org/tracker/source-package/aom&quot;&gt;unsolved
-security issues in Debian Stable&lt;/a&gt;, and to see if the recent
-backport &lt;a href=&quot;https://tracker.debian.org/pkg/aom&quot;&gt;provided in
-Debian&lt;/a&gt; is any quicker, I ran &lt;tt&gt;apt -t bullseye-backports install
-aom-tools&lt;/tt&gt; to fetch the backported version and re-encoded the
-video using the latest version.  This time the &#39;--row-mt=1&#39; option
-worked, and the encoding was done in 46 seconds with a frame rate of
-around 5.22 fps.  This time it seem to be using all my four cores to
-encode.  Encoding speed is still too low for streaming and real time,
-which would require frame rates above 25 fps, but might be good enough
-for offline encoding.&lt;/p&gt;
-
-&lt;p&gt;I am very happy to see AV1 playback working so well with the
-default tools in Debian Stable.  I hope the encoding situation improve
-too, allowing even a slow old computer like my 10 year old laptop to
-be used for encoding.&lt;/p&gt;
-
-&lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
-activities, please send Bitcoin donations to my address
-&lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
-</description>
-       </item>
-       
         </channel>
 </rss>
         </channel>
 </rss>