<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trinitydesktop.net/index.php?action=history&amp;feed=atom&amp;title=Creating_Konqueror_Service_Menus</id>
	<title>Creating Konqueror Service Menus - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trinitydesktop.net/index.php?action=history&amp;feed=atom&amp;title=Creating_Konqueror_Service_Menus"/>
	<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Creating_Konqueror_Service_Menus&amp;action=history"/>
	<updated>2026-05-24T23:51:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Creating_Konqueror_Service_Menus&amp;diff=1672&amp;oldid=prev</id>
		<title>Blu256: Marked +KDE3, added Table of Contents, proper heading levels</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Creating_Konqueror_Service_Menus&amp;diff=1672&amp;oldid=prev"/>
		<updated>2021-08-22T19:47:43Z</updated>

		<summary type="html">&lt;p&gt;Marked +KDE3, added Table of Contents, proper heading levels&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:47, 22 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;[[Category:KDE3]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;[[Category:KDE3]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;[[Category:Tutorials]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;[[Category:Tutorials]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;{{KDE3}}&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/del&gt;Originally http://techbase.kde.org/Development/Tutorials/KDE3/Creating_Konqueror_Service_Menus &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;,&lt;/del&gt; under&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt; Creative Commons License SA 3.0 / GNU Free Documentation License 1.2.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&#039;&#039;&lt;/ins&gt;Originally&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; from&lt;/ins&gt; http://techbase.kde.org/Development/Tutorials/KDE3/Creating_Konqueror_Service_Menus&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Licensed&lt;/ins&gt; under Creative Commons License SA 3.0 / GNU Free Documentation License 1.2.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&#039;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_9_2_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_5_0_lhs&quot;&gt;&lt;/a&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&#039;&#039;&lt;/del&gt;The ability to select mimetype-specific actions from Konqueror&#039;s context menu is an often requested feature. The pleasant surprise is that this is already possible. The even more pleasant surprise is that you don&#039;t need to be a software developer to create new actions. This article details step-by-step how to quickly and easily add new actions to Konqueror&#039;s context menu.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&#039;&#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_9_4_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_8_0_lhs&quot;&gt;&lt;/a&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;= Introduction  &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_5_0_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_9_2_rhs&quot;&gt;&lt;/a&gt;The ability to select mimetype-specific actions from Konqueror&#039;s context menu is an often requested feature. The pleasant surprise is that this is already possible. The even more pleasant surprise is that you don&#039;t need to be a software developer to create new actions. This article details step-by-step how to quickly and easily add new actions to Konqueror&#039;s context menu.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_8_0_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_9_4_rhs&quot;&gt;&lt;/a&gt;= Introduction  =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;In KDE-speak a &quot;servicemenu&quot; is a special entry that appears in Konqueror&#039;s context menu&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;In KDE-speak a &quot;servicemenu&quot; is a special entry that appears in Konqueror&#039;s context menu&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;By the end of this tutorial you should be able to create your own servicemenus with ease.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;By the end of this tutorial you should be able to create your own servicemenus with ease.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;= Where the Servicemenus Live &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= Where the Servicemenus Live =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;Servicemenus are defined using .desktop files, which are the same kind of files that are used&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;Servicemenus are defined using .desktop files, which are the same kind of files that are used&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 41:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;tip: $KDEHOME defaults to ~/.kde when it isn&#039;t set or defined. You can confirm this by running &amp;lt;syntaxhighlight lang=&quot;text&quot;&amp;gt;kde-config --localprefix&amp;lt;/syntaxhighlight&amp;gt; from a Konsole window. To locate where KDE was installed to, run &amp;lt;syntaxhighlight lang=&quot;text&quot;&amp;gt;kde-config --prefix&amp;lt;/syntaxhighlight&amp;gt; from a Konsole window.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;tip: $KDEHOME defaults to ~/.kde when it isn&#039;t set or defined. You can confirm this by running &amp;lt;syntaxhighlight lang=&quot;text&quot;&amp;gt;kde-config --localprefix&amp;lt;/syntaxhighlight&amp;gt; from a Konsole window. To locate where KDE was installed to, run &amp;lt;syntaxhighlight lang=&quot;text&quot;&amp;gt;kde-config --prefix&amp;lt;/syntaxhighlight&amp;gt; from a Konsole window.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;= The Start of Our Servicemenu &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= The Start of Our Servicemenu =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;We will begin creating our wallpaper servicemenu by choosing a name for the file:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;We will begin creating our wallpaper servicemenu by choosing a name for the file:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;setAsWallpaper.desktop sounds good. The only thing that really matters with regards to the name is that it&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;setAsWallpaper.desktop sounds good. The only thing that really matters with regards to the name is that it&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 80:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 85:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;defining what that action does. In fact, that&#039;s our very next step.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;defining what that action does. In fact, that&#039;s our very next step.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;= Creating an Action &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= Creating an Action =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;So far we have defined one action in our servicemenu file: setAsWallpaper. Now we need to define&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;So far we have defined one action in our servicemenu file: setAsWallpaper. Now we need to define&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;what that action looks like and what it actually does. We begin by adding a new heading to the end of our file:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;what that action looks like and what it actually does. We begin by adding a new heading to the end of our file:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 134:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 139:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;Exec&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/bin/sh -c &quot;&amp;amp;lt;YOUR COMMANDS HERE&amp;amp;gt;&quot;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;Exec&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/bin/sh -c &quot;&amp;amp;lt;YOUR COMMANDS HERE&amp;amp;gt;&quot;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;= A Brief Excursion, or &quot;The Amazingly Useful kdcop&quot; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= A Brief Excursion, or &quot;The Amazingly Useful kdcop&quot; =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;[[Image:servicemenus_kdcop.png|thumb|right|400px]] &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;[[Image:servicemenus_kdcop.png|thumb|right|400px]] &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 163:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 168:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;for the guess-and-test method instead.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;for the guess-and-test method instead.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;= And Now Back to Our Regularly Scheduled Broadcast... &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= And Now Back to Our Regularly Scheduled Broadcast... =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;Back from the land of DCOP, we have produced a working servicemenu. Now what? We improve it, of course!&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;Back from the land of DCOP, we have produced a working servicemenu. Now what? We improve it, of course!&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 215:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 220:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;Pretty simple, huh?&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;Pretty simple, huh?&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;= Cha-a-a-a-rge! &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= Cha-a-a-a-rge! =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;Now it&#039;s time to strap on your imagination helmets: What sort of cool and useful servicemenus can you dream up? Open up a text editor and let the mayhem begin! Just don&#039;t forget to share the spoils of your adventures with the rest of us! ;-)&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;Now it&#039;s time to strap on your imagination helmets: What sort of cool and useful servicemenus can you dream up? Open up a text editor and let the mayhem begin! Just don&#039;t forget to share the spoils of your adventures with the rest of us! ;-)&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-188:rev-1672:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Creating_Konqueror_Service_Menus&amp;diff=188&amp;oldid=prev</id>
		<title>imported&gt;Eliddell: Created page with &quot;Category:Developers Category:KDE3 Category:Tutorials  (Originally http://techbase.kde.org/Development/Tutorials/KDE3/Creating_Konqueror_Service_Menus , under  Crea...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Creating_Konqueror_Service_Menus&amp;diff=188&amp;oldid=prev"/>
		<updated>2014-05-22T21:24:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/Category:Developers&quot; title=&quot;Category:Developers&quot;&gt;Category:Developers&lt;/a&gt; &lt;a href=&quot;/Category:KDE3&quot; title=&quot;Category:KDE3&quot;&gt;Category:KDE3&lt;/a&gt; &lt;a href=&quot;/Category:Tutorials&quot; title=&quot;Category:Tutorials&quot;&gt;Category:Tutorials&lt;/a&gt;  (Originally http://techbase.kde.org/Development/Tutorials/KDE3/Creating_Konqueror_Service_Menus , under  Crea...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Developers]]&lt;br /&gt;
[[Category:KDE3]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&lt;br /&gt;
(Originally http://techbase.kde.org/Development/Tutorials/KDE3/Creating_Konqueror_Service_Menus , under  Creative Commons License SA 3.0 / GNU Free Documentation License 1.2.)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;The ability to select mimetype-specific actions from Konqueror&amp;#039;s context menu is an often requested feature. The pleasant surprise is that this is already possible. The even more pleasant surprise is that you don&amp;#039;t need to be a software developer to create new actions. This article details step-by-step how to quickly and easily add new actions to Konqueror&amp;#039;s context menu.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Introduction  ===&lt;br /&gt;
&lt;br /&gt;
In KDE-speak a &amp;quot;servicemenu&amp;quot; is a special entry that appears in Konqueror&amp;#039;s context menu&lt;br /&gt;
depending on the file(s) that are selected. You may have seen them in action without even knowing it.&lt;br /&gt;
For instance, if you have the KDE file archive utility &amp;quot;ark&amp;quot; installed you will see a menu entry&lt;br /&gt;
to &amp;quot;Extract here...&amp;quot; whenever you right click on a tarball or zip file. The option to &amp;quot;Extract here...&amp;quot;&lt;br /&gt;
is a servicemenu.&lt;br /&gt;
&lt;br /&gt;
Creating new servicemenus is very simple, requiring nothing more than an idea and a text editor.&lt;br /&gt;
You don&amp;#039;t have to be a programmer or a KDE wizard to make them.&lt;br /&gt;
In this tutorial we will be creating a set of actions that allows us to set an image as our desktop&lt;br /&gt;
wallpaper just by right clicking on it and selecting &amp;quot;Use As Wallpaper&amp;quot;.&lt;br /&gt;
By the end of this tutorial you should be able to create your own servicemenus with ease.&lt;br /&gt;
&lt;br /&gt;
=== Where the Servicemenus Live ===&lt;br /&gt;
&lt;br /&gt;
Servicemenus are defined using .desktop files, which are the same kind of files that are used&lt;br /&gt;
to create entries in the K Menu or on the KDE desktop. These servicemenu files are found in&lt;br /&gt;
$KDEHOME/share/apps/konqueror/servicemenus, the directory KDE was installed to&lt;br /&gt;
or any directory listed in the $KDEDIRS environment variable.&lt;br /&gt;
&lt;br /&gt;
In the case of my home machine that means that servicemenu files can be found&lt;br /&gt;
in the following places:&lt;br /&gt;
 /opt/kde3/share/apps/konqueror/servicemenus/&lt;br /&gt;
 /usr/share/apps/konqueror/servicemenus/&lt;br /&gt;
 /home/aaron/.kde3/share/apps/konqueror/servicemenus/&lt;br /&gt;
&lt;br /&gt;
tip: $KDEHOME defaults to ~/.kde when it isn&amp;#039;t set or defined. You can confirm this by running &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;kde-config --localprefix&amp;lt;/syntaxhighlight&amp;gt; from a Konsole window. To locate where KDE was installed to, run &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;kde-config --prefix&amp;lt;/syntaxhighlight&amp;gt; from a Konsole window.&lt;br /&gt;
&lt;br /&gt;
=== The Start of Our Servicemenu ===&lt;br /&gt;
We will begin creating our wallpaper servicemenu by choosing a name for the file:&lt;br /&gt;
setAsWallpaper.desktop sounds good. The only thing that really matters with regards to the name is that it&lt;br /&gt;
is unique and that it ends with .desktop. Next we&amp;#039;ll open up the file in a text editor. The&lt;br /&gt;
first thing we will put in the file is the &amp;quot;Desktop Entry&amp;quot; section:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
ServiceTypes=image/png,image/jpeg&lt;br /&gt;
Actions=setAsWallpaper&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every servicemenu file &amp;#039;&amp;#039;must&amp;#039;&amp;#039; have these three lines. Let&amp;#039;s examine each of these lines one at a time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
KDE configuration files, including .desktop files, seperate the individual settings into sections. A section starts&lt;br /&gt;
with a heading made up of letters, numbers and spaces in between square brackets on a line&lt;br /&gt;
by itself. This first line means that all the options that follow, up until the next heading,&lt;br /&gt;
belong to the &amp;quot;Desktop Entry&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
ServiceTypes=image/png,image/jpeg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ServiceTypes entry refers to the mimetypes that this servicemenu applies to. You can define more than one&lt;br /&gt;
mimetype by providing a list seperated by commas (but no spaces). In this case we our servicemenu will show&lt;br /&gt;
up when we select PNG or JPEG images. The File Associations control panel is a good place to look for mimetype definitions.&lt;br /&gt;
&lt;br /&gt;
Tip: To create a servicemenu for directories use the &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;inode/directory&amp;lt;/syntaxhighlight&amp;gt; mimetype. To create a servicemenu for all files, use the special &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;all/all&amp;lt;/syntaxhighlight&amp;gt; mimetype. To create a servicemenu for all files, but not directories, use the &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;all/allfiles&amp;lt;/syntaxhighlight&amp;gt; mimetype.&lt;br /&gt;
&lt;br /&gt;
You can also specify an entire group of mimetypes using &amp;quot;typeglobs&amp;quot;. To make our servicemenu apply not only to PNGs and JPEGs but to all images we would simply change the ServiceTypes entry to be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
ServiceTypes=image/*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now when we right click on &amp;#039;&amp;#039;any&amp;#039;&amp;#039; image file in Konqueror we can select it as our background.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
Actions=setAsWallpaper&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The Actions entry defines the actions we will create in our servicemenu. As with the ServiceTypes, you can define more&lt;br /&gt;
than one action by using a semicolon separated list. Each of the actions listed will get a section of its own&lt;br /&gt;
defining what that action does. In fact, that&amp;#039;s our very next step.&lt;br /&gt;
&lt;br /&gt;
=== Creating an Action ===&lt;br /&gt;
So far we have defined one action in our servicemenu file: setAsWallpaper. Now we need to define&lt;br /&gt;
what that action looks like and what it actually does. We begin by adding a new heading to the end of our file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Action setAsWallpaper]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that it contains the setAsWallpaper action name. It is important to note that these files&lt;br /&gt;
are case sensitive, so we need to watch the capitalization here. Now that we have a section for our action,&lt;br /&gt;
let&amp;#039;s give our action a name that the user will see.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
Name=Set As Background Image&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To translate the name, we add another &amp;lt;tt&amp;gt;Name&amp;lt;/tt&amp;gt; entry followed by the language code. For instance, the French translation for the &amp;quot;Open Terminal Here&amp;quot; service is provided by an entry that looks like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
Name[fr]=Ouvrir un terminal ici&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next let&amp;#039;s add an icon:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
Icon=background&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that we didn&amp;#039;t include the .png file extension, but just referred to the icon by name. If we had left&lt;br /&gt;
this line out our action would still work, it just wouldn&amp;#039;t look as fancy. Now that we&amp;#039;ve achieved&lt;br /&gt;
fancyness, let&amp;#039;s finish up by making it useful:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Exec line defines what is run when the user selects the action from the menu. We can put any command we want&lt;br /&gt;
there. The magic in this line is the &amp;quot;%u&amp;quot; which gets replaced with the URL of the image file before the&lt;br /&gt;
command is run. If our command can accept more than one file at a time we can use &amp;quot;%U&amp;quot; instead.&lt;br /&gt;
There are [http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html other special %values] but %u and %U are probably the most useful for servicemenus.&lt;br /&gt;
&lt;br /&gt;
Our file now looks like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
ServiceTypes=image/*&lt;br /&gt;
Actions=setAsWallpaper&lt;br /&gt;
&lt;br /&gt;
[Desktop Action setAsWallpaper]&lt;br /&gt;
Name=Use As Wallpaper&lt;br /&gt;
Icon=background&lt;br /&gt;
Exec=dcop kdesktop KBackgroundIface setWallpaper %U 6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we save it and open up Konqueror, when we right click on a PNG, JPEG or GIF image we should now have a&lt;br /&gt;
&amp;quot;Set as background&amp;quot; item in the menu. Try it out!&lt;br /&gt;
&lt;br /&gt;
Tip: If you have a complex task that requires more than one command (for example if we wanted to copy the image file somewhere first and then use dcop to set it as the background) use a shell:&amp;lt;br/&amp;gt;&lt;br /&gt;
Exec&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/bin/sh -c &amp;quot;&amp;amp;lt;YOUR COMMANDS HERE&amp;amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== A Brief Excursion, or &amp;quot;The Amazingly Useful kdcop&amp;quot; ===&lt;br /&gt;
[[Image:servicemenus_kdcop.png|thumb|right|400px]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before we explore with our servicemenu a bit more, let&amp;#039;s take a look at that exec line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
Exec=dcop kdesktop KBackgroundIface setWallpaper %U 6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It may look complicated but it really isn&amp;#039;t. The command takes&lt;br /&gt;
advantage of the KDE DCOP service which is used by KDE programs to talk to each other. Fortunately for us, we can also&lt;br /&gt;
use it for scripting.&lt;br /&gt;
&lt;br /&gt;
The first thing I did when formulating the Exec line was to run &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;kdcop&amp;lt;/syntaxhighlight&amp;gt; which is a graphical DCOP browser.&lt;br /&gt;
Using it you can see every DCOP interface that is available for use at that moment. Browsing through the listing I found the&lt;br /&gt;
kdesktop entry and expanded it. Under kdesktop I quickly found the KBackgroundIface, and expanding that node of the tree&lt;br /&gt;
I spotted what I was looking for: &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;setWallpaper&amp;lt;/syntaxhighlight&amp;gt;! According to the listing it took two arguments:&lt;br /&gt;
* a QString (which is just a bunch of text) called &amp;quot;wallpaper&amp;quot;&lt;br /&gt;
* an integer called (somewhat mysteriously) &amp;quot;mode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
With setAsWallpaper.desktop open in KWrite I simply&lt;br /&gt;
dragged and dropped the setWallpaper entry into Exec line!&lt;br /&gt;
From there I replaced the parameters &amp;quot;wallpaper mode&amp;quot; with &amp;quot;%U 6&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Presto! Blamo! It worked! Now you&amp;#039;re probably wondering where I got the number 6 from. The answer&lt;br /&gt;
is I tried a bunch of numbers starting at 0 and working my way up until I achieved the results I&lt;br /&gt;
wanted. I could&amp;#039;ve looked at the source code or read the developer&amp;#039;s documentation, but I opted&lt;br /&gt;
for the guess-and-test method instead.&lt;br /&gt;
&lt;br /&gt;
=== And Now Back to Our Regularly Scheduled Broadcast... ===&lt;br /&gt;
&lt;br /&gt;
Back from the land of DCOP, we have produced a working servicemenu. Now what? We improve it, of course!&lt;br /&gt;
&lt;br /&gt;
Our current servicemenu scales the image to the size of the desktop and sets it as the wallpaper.&lt;br /&gt;
But this isn&amp;#039;t appropriate for wallpaper tiles which not be scaled but should be, well, &amp;#039;&amp;#039;tiled&amp;#039;&amp;#039;.&lt;br /&gt;
So let&amp;#039;s add an action for tiles.&lt;br /&gt;
First we&amp;#039;ll need to change the Actions line&lt;br /&gt;
to say something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Actions=setAsWallpaper;tileAsWallpaper&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note the use of a semicolon. While the ServiceTypes are separated by commas, Actions are separated with semicolons.&lt;br /&gt;
Quirks-R-Us. Moving right along, we&amp;#039;ll add a new action section to the end of the file that looks something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Action tileAsWallpaper]&lt;br /&gt;
Name=Use As Wallpaper Tile&lt;br /&gt;
Icon=background&lt;br /&gt;
Exec=dcop kdesktop KBackgroundIface setWallpaper %U 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;tileAsWallpaper&amp;quot; appears in the action section&amp;#039;s heading. This is what&lt;br /&gt;
tells Konqueror which action it is. In addition, we have a slightly different Name and a very slightly&lt;br /&gt;
different Exec line. Now when we right click on an image we have another option, this time to tile&lt;br /&gt;
the image across our desktop. We didn&amp;#039;t even have to restart Konqueror, since it automatically rereads&lt;br /&gt;
the file when it changes!&lt;br /&gt;
&lt;br /&gt;
KDE&amp;#039;s desktop offers several background image options, of which Scale and Tile are just two. Of course if we start adding all those various background options, and then add those to all the other servicemenus that a typical KDE installation has it&amp;#039;s easy to see how the Action menu can quickly get out of hand. Starting with KDE 3.2 we can create submenus for our servicemenus by adding a line like the following to the &amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;[Desktop Entry]&amp;lt;/syntaxhighlight&amp;gt; group of the .desktop file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
X-KDE-Submenu=Set As Background&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will create a submenu called &amp;quot;Set As Background&amp;quot; and put all of the servicemenu&amp;#039;s actions into it.&lt;br /&gt;
Our servicemenu .desktop file now looks like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
ServiceTypes=image/*&lt;br /&gt;
Actions=setAsWallpaper;tileAsWallpaper&lt;br /&gt;
X-KDE-Submenu=Use As Wallpaper&lt;br /&gt;
&lt;br /&gt;
[Desktop Action setAsWallpaper]&lt;br /&gt;
Name=Scaled&lt;br /&gt;
Icon=background&lt;br /&gt;
Exec=dcop kdesktop KBackgroundIface setWallpaper %U 6&lt;br /&gt;
&lt;br /&gt;
[Desktop Action tileAsWallpaper]&lt;br /&gt;
Name=Tiled&lt;br /&gt;
Icon=background&lt;br /&gt;
Exec=dcop kdesktop KBackgroundIface setWallpaper %U 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pretty simple, huh?&lt;br /&gt;
&lt;br /&gt;
=== Cha-a-a-a-rge! ===&lt;br /&gt;
Now it&amp;#039;s time to strap on your imagination helmets: What sort of cool and useful servicemenus can you dream up? Open up a text editor and let the mayhem begin! Just don&amp;#039;t forget to share the spoils of your adventures with the rest of us! ;-)&lt;/div&gt;</summary>
		<author><name>imported&gt;Eliddell</name></author>
	</entry>
</feed>