Warning, /utilities/krusader/doc/handbook/useraction-xml.docbook is written in an unsupported language. File is not indexed.

0001 <!--
0002     SPDX-FileCopyrightText: 2000-2003 Shie Erlich <erlich@users.sourceforge.net>
0003     SPDX-FileCopyrightText: 2000-2003 Rafi Yanai <yanai@users.sourceforge.net>
0004     SPDX-FileCopyrightText: 2004-2010 Frank Schoolmeesters <codeknight@users.sourceforge.net>
0005     SPDX-FileCopyrightText: 2000-2022 Krusader Krew <https://krusader.org>
0006 -->
0007 <appendix id="useraction-xml">
0008   <title>useractions.xml</title>
0009   <para>This appendix gives several examples of 
0010   <filename>useractions.xml</filename> files. With this you can begin
0011   to discover the power of the <link linkend="useractions">UserActions</link> and
0012   start learning how to use them. Once you understand how to write
0013   UserActions you will find that &krusader; is an even
0014   more powerful, customizable tool.</para>
0015   <para>Please consider uploading your UserActions at
0016   <ulink url="https://store.kde.org">store.kde.org</ulink> as we are collecting them. If your UserAction is selected by us it will be shipped with
0017   &krusader; at the next release.</para>
0018 
0019 <itemizedlist>
0020     <listitem><para>Runs <command>uptime</command>
0021     <programlisting>
0022 &lt;!DOCTYPE KrusaderUserActions>
0023  &lt;KrusaderUserActions>
0024   &lt;action name="uptime" >
0025   &lt;title>Up-time&lt;/title>
0026   &lt;tooltip>tells how long since the computer has been booted&lt;/tooltip>
0027   &lt;icon>clock&lt;/icon>
0028   &lt;category>information&lt;/category>
0029   &lt;description same_as="tooltip" />
0030   &lt;command executionmode="collect_output" >uptime&lt;/command>
0031   &lt;defaultshortcut>Alt+Ctrl+U&lt;/defaultshortcut>
0032  &lt;/action>
0033 &lt;/KrusaderUserActions></programlisting>
0034     </para></listitem>
0035 
0036     <listitem><para>Runs <command>ls -l</command>
0037     <programlisting>
0038 &lt;!DOCTYPE KrusaderUserActions>
0039  &lt;KrusaderUserActions>
0040   &lt;action name="ls -l" >
0041   &lt;title>ls -l in current dir&lt;/title>
0042   &lt;description same_as="tooltip" />
0043   &lt;command executionmode="collect_output" >ls -l %aPath% %oPath%&lt;/command>
0044  &lt;/action>
0045 &lt;/KrusaderUserActions></programlisting>
0046     </para></listitem>
0047 
0048     <listitem><para>Echo Placeholder
0049     <programlisting>
0050 &lt;!DOCTYPE KrusaderUserActions>
0051  &lt;KrusaderUserActions>
0052   &lt;action name="test_placeholder" >
0053   &lt;title>Echo Placeholder&lt;/title>
0054   &lt;tooltip>Echo's the placeholder values&lt;/tooltip>
0055   &lt;category>Testing&lt;/category>
0056   &lt;description same_as="tooltip" />
0057   &lt;command executionmode="collect_output" onmultiplefiles="call_each" >echo -e &quot;aPath %aPath()%  \naCurrent: %aCurrent()%&quot;&lt;/command>
0058  &lt;/action>
0059 &lt;/KrusaderUserActions></programlisting>
0060     </para></listitem>
0061 
0062       <listitem><para>This useraction copies current path and filename to clipboard:
0063       <programlisting>
0064 &lt;!DOCTYPE KrusaderUserActions>
0065 &lt;KrusaderUserActions>
0066  &lt;action name="clipboard current" >
0067   &lt;title>Copy to Clipboard&lt;/title>
0068   &lt;tooltip>Copy to clipboard&lt;/tooltip>
0069   &lt;icon>klipper&lt;/icon>
0070   &lt;category>System&lt;/category>
0071   &lt;description>Copy current path and filename to clipboard&lt;/description>
0072   &lt;command>%_Clipboard(&quot;%aCurrent%&quot;)%&lt;/command>
0073   &lt;defaultshortcut>Win+C&lt;/defaultshortcut>
0074  &lt;/action>
0075 &lt;/KrusaderUserActions></programlisting>
0076       </para></listitem>
0077 
0078       <listitem><para>Selects <literal role="extension">.diff</literal> and <literal role="extension">*.h</literal> in the active panel:
0079       <programlisting>
0080 &lt;!DOCTYPE KrusaderUserActions>
0081 &lt;KrusaderUserActions>
0082  &lt;action name="test_select" >
0083   &lt;title>Add selection *.diff and *.h&lt;/title>
0084   &lt;category>Selection&lt;/category>
0085   &lt;command>%aSelect(&quot;*.diff&quot;, &quot;add&quot;)% %aSelect(&quot;*.h&quot;, &quot;add&quot;)%&lt;/command>
0086  &lt;/action>
0087 &lt;/KrusaderUserActions></programlisting>
0088       </para></listitem>
0089 
0090       <listitem><para>Active panel changes to <filename>mnt/floppy</filename> (bookmark):
0091       <programlisting>
0092 &lt;!DOCTYPE KrusaderUserActions>
0093 &lt;KrusaderUserActions>
0094 &lt;action name="mnt/floppy bookmark" >
0095   &lt;title>Jump to /mnt/floppy&lt;/title>
0096   &lt;category>Bookmarks&lt;/category>
0097   &lt;command>%aGoto(&quot;/mnt/floppy&quot;, &quot;yes&quot;)%&lt;/command>
0098  &lt;/action>
0099 &lt;/KrusaderUserActions></programlisting>
0100       </para></listitem>
0101 
0102       <listitem><para>Select in the non-active panel, all filenames that are highlighted in the active panel:
0103       <programlisting>
0104 &lt;!DOCTYPE KrusaderUserActions>
0105 &lt;KrusaderUserActions>
0106  &lt;action name="asdfasdf" >
0107   &lt;title>Select in Other Panel&lt;/title>
0108   &lt;category>Selection&lt;/category>
0109   &lt;description>Select all filenames that are selected in the active panel, also in the non-active panel&lt;/description>
0110   &lt;command>%oSelect(&quot;%aList(&quot;selected&quot;, &quot; &quot;, &quot;Yes&quot;)%&quot;)%&lt;/command>
0111  &lt;/action>
0112 &lt;/KrusaderUserActions></programlisting>
0113       </para></listitem>
0114 
0115       <listitem><para>Make a backup of the current file/folder to <filename>foo.bak</filename> into the current folder:
0116       <programlisting>
0117 &lt;!DOCTYPE KrusaderUserActions>
0118 &lt;KrusaderUserActions>
0119  &lt;action name="backup current" >
0120   &lt;title>Backup in Current Directory&lt;/title>
0121   &lt;tooltip>Backup in current folder&lt;/tooltip>
0122   &lt;icon>document-save-as&lt;/icon>
0123   &lt;category>System&lt;/category>
0124   &lt;description same_as="tooltip" />
0125   &lt;command>%_Copy(&quot;%aCurrent%&quot;, &quot;%_Ask(&quot;new name&quot;, &quot;%aCurrent%.bak&quot;)%&quot;)%&lt;/command>
0126   &lt;defaultshortcut>Shift+F5&lt;/defaultshortcut>
0127  &lt;/action>
0128 &lt;/KrusaderUserActions></programlisting>
0129       </para></listitem>
0130 
0131       <listitem><para>Opens <link linkend="krusearcher">KruSearcher</link>:
0132       <programlisting>
0133 &lt;!DOCTYPE KrusaderUserActions>
0134 &lt;KrusaderUserActions>
0135  &lt;action name="search" >
0136   &lt;title>Search Test&lt;/title>
0137   &lt;command>%_NewSearch(&quot;Search 2&quot;)%&lt;/command>
0138  &lt;/action>
0139 &lt;/KrusaderUserActions></programlisting>
0140       </para></listitem>
0141 
0142       <listitem><para>Sets the selected picture as wallpaper:
0143       <programlisting>
0144 &lt;!DOCTYPE KrusaderUserActions>
0145 &lt;KrusaderUserActions>
0146  &lt;action name="set wallpaper" >
0147   &lt;title>Set as Wallpaper&lt;/title>
0148   &lt;tooltip>Set as wallpaper&lt;/tooltip>
0149   &lt;icon>image&lt;/icon>
0150   &lt;category>Service Menu&lt;/category>
0151   &lt;description>Set as wallpaper (scaled)&lt;/description>
0152   &lt;command>dcop kdesktop KBackgroundIface setWallpaper &quot;%aCurrent%&quot; 6&lt;/command>
0153   &lt;defaultshortcut>Win+W&lt;/defaultshortcut>
0154  &lt;/action>
0155 &lt;/KrusaderUserActions></programlisting>
0156       </para></listitem>
0157 
0158       <listitem><para>This useraction edits a file with root permissions using <command>kdesu</command>:
0159       <programlisting>
0160 &lt;!DOCTYPE KrusaderUserActions>
0161 &lt;KrusaderUserActions>
0162  &lt;action name="edit as root" >
0163   &lt;title>Edit as Root&lt;/title>
0164   &lt;tooltip>Edit as root&lt;/tooltip>
0165   &lt;icon>kwrite&lt;/icon>
0166   &lt;category>System&lt;/category>
0167   &lt;description>Edit a file with root permissions using kdesu&lt;/description>
0168   &lt;command>kdesu kwrite %aCurrent%&lt;/command>
0169   &lt;defaultshortcut>Win+F4&lt;/defaultshortcut>
0170  &lt;/action>
0171 &lt;/KrusaderUserActions></programlisting>
0172       </para></listitem>
0173 
0174       <listitem><para>This useraction Add item(s) to Amarok playlist:
0175       <programlisting>
0176 &lt;!DOCTYPE KrusaderUserActions>
0177 &lt;KrusaderUserActions>
0178  &lt;action name="amarok enqueue" >
0179   &lt;title>Enqueue in Amarok&lt;/title>
0180   &lt;tooltip>Append selected item(s) to Amarok playlist&lt;/tooltip>
0181   &lt;icon>amarok&lt;/icon>
0182   &lt;category>Multimedia&lt;/category>
0183   &lt;description same_as="tooltip" />
0184   &lt;command>amarok --append %aList(&quot;Selected&quot;)%&lt;/command>
0185   &lt;defaultshortcut>Win+A&lt;/defaultshortcut>
0186  &lt;/action>
0187 &lt;/KrusaderUserActions></programlisting>
0188       </para></listitem>
0189 
0190       <listitem><para>Opens <link linkend="synchronizer">Synchronizer</link>:
0191       <programlisting>
0192 &lt;!DOCTYPE KrusaderUserActions>
0193 &lt;KrusaderUserActions>
0194  &lt;action name="synchronizer" >
0195   &lt;title>Synchronizer&lt;/title>
0196   &lt;command>%_Sync(&quot;Sync 2&quot;)%&lt;/command>
0197  &lt;/action>
0198 &lt;/KrusaderUserActions></programlisting>
0199       </para></listitem>
0200 
0201 </itemizedlist>
0202 
0203 </appendix>