<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  
  
  <channel>
    <title>chrisjrob: kiosktool</title>
    <link>https://chrisjrob.com</link>
    <atom:link href="https://chrisjrob.com/tag/kiosktool/feed/index.xml" rel="self" type="application/rss+xml" />
    <description>GNU Linux, Perl and FLOSS</description>
    <language>en-gb</language>
    <pubDate>Fri, 13 Feb 2026 17:22:31 +0000</pubDate>
    <lastBuildDate>Fri, 13 Feb 2026 17:22:31 +0000</lastBuildDate>
    
    <item>
      <title>Fixing KDE File Associations</title>
      <link>https://chrisjrob.com/2011/03/03/fixing-kde-file-associations/</link>
      <pubDate>Thu, 03 Mar 2011 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2011/03/03/fixing-kde-file-associations</guid>
      <description>
       <![CDATA[
         
         <p>We have our file associations locked down using KDE Kiosktool, and yet
it seems that one of our users has managed to change their file
associations, despite them being locked down; which seems to be because
the context menu is not locked down, enabling him to take the option to
Open With an alternative application and select the checkbox to remember
that association in future.  The only way around this would seem to be
to disable the context sensitive menu, at a significant cost in
functionality.</p>

<!--more-->

<p>So now this user’s PDFs open in Acrobat Reader <strong>on our Windows
server</strong>, instead of using Acrobat Reader on Linux.  That would not in
itself cause a problem, except that the Windows server cannot access the
location of the temporary location of Kmail attachments.  I could
probably fix that, but I don’t really want users opening email
attachments using Windows applications.</p>

<p>This user cannot access File Associations to fix this problem, as the
menu option is removed; so I need to find a way to fix this problem from
the command line.</p>

<p>In solving this particular problem I discovered the existence of the
users’ <code class="language-plaintext highlighter-rouge">~/.local/share/application</code> directory, and was able to remove the
application shortcut to the PDF and normal functionality was restored,
but I thought it would be worth writing up what I have found to be the
case.  Some of the following information may be wrong or misleading and
please feel free to comment any issues, and I will endeavour to update
this page accordingly.</p>

<h2 id="kde-file-associations">KDE File Associations</h2>

<p>I have to say that KDE file associations seem hellishly complicated,
which is to say that there are so many different locations of files that
it is very difficult to work out what is happening.  The three key
factors in play seem to be:</p>

<h3 id="mime-types">MIME Types</h3>

<p>Mime-types, appear to be stored in:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">~/.kde/share/mimelnk</code> directories (for each user)</li>
  <li><code class="language-plaintext highlighter-rouge">/usr/share/mimelnk</code></li>
  <li><code class="language-plaintext highlighter-rouge">/etc/kde-profile/standard/share/mimelnk</code> (for kiosktool - a symlink
back to <code class="language-plaintext highlighter-rouge">/usr/share/mimelnk</code>)</li>
</ul>

<p>These look like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cat pdf.desktop
[Desktop Entry]
Comment=PDF
DocumentHidden=false
Icon=application-pdf
MimeType=application/pdf
Patterns=*.pdf;*.PDF
Type=MimeType
X-KDE-AutoEmbed=false
</code></pre></div></div>

<p>In other words they link the file extension, in this case <code class="language-plaintext highlighter-rouge">*.pdf</code>, with
the MimeType, in this case <code class="language-plaintext highlighter-rouge">application/pdf</code>.  I believe I am right in
saying that the users’ files take precedence over the global ones.</p>

<h3 id="application-shortcuts">Application Shortcuts</h3>

<p>Next up are the application shortcuts, and these also can be in diverse
locations:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">~/.kde/share/applnk</code></li>
  <li><code class="language-plaintext highlighter-rouge">~/.local/share/applications</code></li>
  <li><code class="language-plaintext highlighter-rouge">/usr/share/applications</code></li>
  <li><code class="language-plaintext highlighter-rouge">/etc/kde-profile/standard/share/applications</code> (for kiosk-tool)</li>
</ul>

<p>As with the mimetypes, the users’ copy take precedence over the shared
ones.  These application shortcuts define how to run an application, and
look something like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cat "Adobe Reader 9 PDF Viewer.desktop"
[Desktop Entry]
Comment=
Exec=acroread
GenericName=PDF
ViewerIcon=AdobeReader9
MimeType=
Name=Adobe Reader 9
Path=
StartupNotify=false
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
</code></pre></div></div>

<p>As you can see, this tells the system how to run the application.</p>

<h3 id="profilerc">profilerc</h3>

<p>Lastly there needs to be some way of tying the above two things
together, something that tells the system that you use X application
shortcut to open Y mime-type, and this appears to be the role of the
<code class="language-plaintext highlighter-rouge">profilerc</code> files.  As with the other components, there are multiple
copies of this file:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">~/.kde/share/config/profilerc</code></li>
  <li><code class="language-plaintext highlighter-rouge">/etc/kde-profile/standard/share/config/profilerc</code></li>
</ul>

<p>An extract of this file in respect of my PDF example, looks something
like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[application/pdf - 1]
AllowAsDefault=true
Application=Adobe Reader 8 PDF Viewer.desktop
GenericServiceType=Application
Preference=2
ServiceType=application/pdf
[application/pdf - 2]
AllowAsDefault=true
Application=kpdf_part.desktop
GenericServiceType=KParts/ReadOnlyPart
Preference=1
ServiceType=application/pdf
[application/pdf - 3]
AllowAsDefault=true
Application=kde-kpdf.desktop
GenericServiceType=Application
Preference=2
ServiceType=application/pdf
</code></pre></div></div>

<p>This shows both the mime-type <code class="language-plaintext highlighter-rouge">application/pdf</code> and the application
shortcut, e.g. “Adobe Reader 8 PDF Viewer.desktop”, and gives the
different choices for opening the same mimetype.</p>

<p>I have found this exercise to be hugely frustrating, and I hope this
information is of use to someone.  As I said earlier, my intention will
be to correct this post as I find out more, so please forgive any
errors, and if you have the time, please do let me know by commenting
below.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Kiosktool</title>
      <link>https://chrisjrob.com/2010/09/29/install-kiosktool/</link>
      <pubDate>Wed, 29 Sep 2010 10:06:35 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/09/29/install-kiosktool</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/kiosktool3.png" align="right" alt="Featured Image">
         
         <p>First let’s take a look at where KDE squirrels away all these settings. KDE is complex, but it’s well-organised, and there is always a method to whatever KDE madness you find yourself in.</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">/etc/kderc</code> :  This points to the file locations where configuration profiles are stored.</li>
  <li><code class="language-plaintext highlighter-rouge">/etc/kde3</code> : Global configuration files are here.</li>
  <li><code class="language-plaintext highlighter-rouge">/home/~username~/.kde</code> : User’s individual settings go here.</li>
</ul>

<!--more-->

<p>You can see for yourself where your particular KDE installation is going to look for configuration files:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ kde-config --path config
/home/carla/.kde/share/config/:/etc/kde3/:/usr/share/kubuntu-
default-settings/kde-profile/default/share/config/
</code></pre></div></div>

<p>KDE reads these in reverse order, so if it encounters any conflicts, the last value read is the one used. User’s individual configurations take precedence, so they are read last. 
There is a way to make an exception to the precedence rule: using $i, or the “immutable” key. You’ll see how this is used in the examples below. Anything marked immutable has precedence, no matter what order it’s in.</p>

<h2 id="installing-kiosktool">Installing Kiosktool</h2>

<p><strong>This is now unnecessary, as this has been fixed on Debian, you should now be able to simply do an aptitude install.</strong></p>

<p>Kiosktool is simply an easy way of administering the above files. Kiosk Admin Tool is available in Debian Testing/Unstable and should be as simple to install as:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install kiosktool
</code></pre></div></div>

<p>Unfortunately the current version of Kiosktool is broken for Debian, as Debian have changed the filename for the menu configuration from applications.menu to kde-applications.menu, and unfortunately Kiosktool is now unmaintained, so to install requires a few more steps than normal:</p>

<h3 id="install-the-build-dependencies">Install the build dependencies</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get build-dep kiosktool
</code></pre></div></div>

<p><strong>Before installing the dependencies, please copy them into the clipboard.</strong></p>

<h3 id="download-the-source">Download the source</h3>

<p>Note that you do not need to be root to do this, and it helps later if you’re not! Change your repository if necessary, or remove it entirely to install from your default repository. Note however that at the time of writing Kiosktool is only available in testing, unstable and backports (the same versions in each).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get -t etch-backports source kiosktool
</code></pre></div></div>

<h3 id="edit-the-source">Edit the source</h3>

<p>This will download three files: a .orig.tar.gz, a .dsc and a .diff.gz. In the case of packages made specifically for Debian, the last of these is not downloaded and the first usually won’t have “orig” in the name. The .dsc file is used by dpkg-source for unpacking the source package into the directory packagename-version. Within each downloaded source package there is a debian/ directory that contains the files needed for creating the .deb package.</p>

<p>Navigate to this directory and open the following file in a text editor:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/path/to/kiosktool-1.0/kiosktool/menueditComponent.cpp
</code></pre></div></div>

<p>Replace all instances of applications.menu with kde-applications.menu.</p>

<h3 id="build-the-deb">Build the deb</h3>

<p>From within the directory that was created for the package after downloading.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get -b source kiosktool
</code></pre></div></div>

<p>To install the package built by the commands above one must use the package manager directly, like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># dpkg -i kiosktool-&lt;version&gt;.deb
</code></pre></div></div>

<h3 id="remove-the-build-dependencies">Remove the build dependencies</h3>

<p>It seems that some of the build dependencies may be incompatible with the LTSP enlightened sound daemon (esd), if you copied them (as recommended in Install the build dependencies section), then please purge them now. Otherwise you will need to review <code class="language-plaintext highlighter-rouge">/var/log/dpkg.log</code> for the relevant files.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get --purge remove package1 package2 etc
</code></pre></div></div>

<h2 id="using-kiosktool">Using Kiosktool</h2>

<p>After installation you should have a menu entry for it in System -&gt; KIOSK Admin Tool, or use the kiosktool command to start it from the command prompt.</p>

<p>You may find that a copying dialog crops up at regular intervals and that often it will stall, please read:</p>

<ul>
  <li><a href="/2010/09/29/fix-kiosktool-fish-protocol-stalls/">Fix kiosktool fish protocol stalls</a></li>
</ul>

<h2 id="references">References</h2>

<p>This document was cobbled from the following sources:</p>

<ul>
  <li><a href="http://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.en.html">APT HOWTO Chapter 6 Working with source packages</a></li>
  <li><a href="http://www.enterprisenetworkingplanet.com/netos/article.php/3573736">Lock Down Desktops with KDE Kiosk by Carla Schroder</a></li>
</ul>

<p>Other references:</p>

<ul>
  <li>http://techbase.kde.org/User:Danimo/KIOSK</li>
</ul>

<p>The advice in the Edit the source section was copied from a mailing list post, which I now cannot find. The post also mentioned that patches were available for this issue, although I could not find any such patches, and anyway the method above is probably just as easy.</p>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Fix Kiosktool Fish Protocol Stalls</title>
      <link>https://chrisjrob.com/2010/09/29/fix-kiosktool-fish-protocol-stalls/</link>
      <pubDate>Wed, 29 Sep 2010 10:05:41 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/09/29/fix-kiosktool-fish-protocol-stalls</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/kiosk_1.gif" align="right" alt="Featured Image">
         
         <p>When making changes to profiles under kiosktool, it stalls when uploading changes to the local machine using the fish protocol, see screenshots.</p>

<p>Persistently clicking cancel followed by retry does deliver the goods, but sometimes it can take ten attempts or more, with the load average quickly escalating to ten times the server’s usual level.</p>

<!--more-->

<p>I understand it requires the fish protocol, even though it is editing the local machine, because kiosk has to be run as a standard user, but requires root access to edit the profile.</p>

<p>The fish protocol usually works fine in konqueror.</p>

<p>Under our Kiosk configuration I have the base directory set as <code class="language-plaintext highlighter-rouge">/etc/kde-profile</code> and the option “On exit, upload profiles to a remote server” is unchecked.</p>

<h2 id="screenshots">Screenshots</h2>

<p><img src="/assets/kiosk_1.gif" />
<img src="/assets/kiosk_2.gif" />
<img src="/assets/kiosk_3.gif" /></p>

<h2 id="workaround">Workaround</h2>

<p>Keep cancelling the copy and then retry.</p>

<p><strong>Never come out without successfully completing the copy, or you can end up with corruption in your personal desktop, or menus, or even end up unable to log in.  You have been warned.</strong></p>

<h2 id="the-solution">The Solution</h2>

<p>The solution seems to be to edit the menu entry for Kiosk-Tool and change it to:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>env KDE_FORK_SLAVES=true kiosktool
</code></pre></div></div>

<h2 id="references">References</h2>

<ul>
  <li>http://lists.kde.org/?t=111633283900002&amp;r=1&amp;w=2 (Similar problem under SUSE)</li>
  <li>http://bugs.kde.org/show_bug.cgi?id=8137 (similar problem under FreeBSD)</li>
</ul>

       ]]>
      </description>
    </item>
    
  </channel> 
</rss>
