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 <!DOCTYPE KrusaderUserActions> 0023 <KrusaderUserActions> 0024 <action name="uptime" > 0025 <title>Up-time</title> 0026 <tooltip>tells how long since the computer has been booted</tooltip> 0027 <icon>clock</icon> 0028 <category>information</category> 0029 <description same_as="tooltip" /> 0030 <command executionmode="collect_output" >uptime</command> 0031 <defaultshortcut>Alt+Ctrl+U</defaultshortcut> 0032 </action> 0033 </KrusaderUserActions></programlisting> 0034 </para></listitem> 0035 0036 <listitem><para>Runs <command>ls -l</command> 0037 <programlisting> 0038 <!DOCTYPE KrusaderUserActions> 0039 <KrusaderUserActions> 0040 <action name="ls -l" > 0041 <title>ls -l in current dir</title> 0042 <description same_as="tooltip" /> 0043 <command executionmode="collect_output" >ls -l %aPath% %oPath%</command> 0044 </action> 0045 </KrusaderUserActions></programlisting> 0046 </para></listitem> 0047 0048 <listitem><para>Echo Placeholder 0049 <programlisting> 0050 <!DOCTYPE KrusaderUserActions> 0051 <KrusaderUserActions> 0052 <action name="test_placeholder" > 0053 <title>Echo Placeholder</title> 0054 <tooltip>Echo's the placeholder values</tooltip> 0055 <category>Testing</category> 0056 <description same_as="tooltip" /> 0057 <command executionmode="collect_output" onmultiplefiles="call_each" >echo -e "aPath %aPath()% \naCurrent: %aCurrent()%"</command> 0058 </action> 0059 </KrusaderUserActions></programlisting> 0060 </para></listitem> 0061 0062 <listitem><para>This useraction copies current path and filename to clipboard: 0063 <programlisting> 0064 <!DOCTYPE KrusaderUserActions> 0065 <KrusaderUserActions> 0066 <action name="clipboard current" > 0067 <title>Copy to Clipboard</title> 0068 <tooltip>Copy to clipboard</tooltip> 0069 <icon>klipper</icon> 0070 <category>System</category> 0071 <description>Copy current path and filename to clipboard</description> 0072 <command>%_Clipboard("%aCurrent%")%</command> 0073 <defaultshortcut>Win+C</defaultshortcut> 0074 </action> 0075 </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 <!DOCTYPE KrusaderUserActions> 0081 <KrusaderUserActions> 0082 <action name="test_select" > 0083 <title>Add selection *.diff and *.h</title> 0084 <category>Selection</category> 0085 <command>%aSelect("*.diff", "add")% %aSelect("*.h", "add")%</command> 0086 </action> 0087 </KrusaderUserActions></programlisting> 0088 </para></listitem> 0089 0090 <listitem><para>Active panel changes to <filename>mnt/floppy</filename> (bookmark): 0091 <programlisting> 0092 <!DOCTYPE KrusaderUserActions> 0093 <KrusaderUserActions> 0094 <action name="mnt/floppy bookmark" > 0095 <title>Jump to /mnt/floppy</title> 0096 <category>Bookmarks</category> 0097 <command>%aGoto("/mnt/floppy", "yes")%</command> 0098 </action> 0099 </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 <!DOCTYPE KrusaderUserActions> 0105 <KrusaderUserActions> 0106 <action name="asdfasdf" > 0107 <title>Select in Other Panel</title> 0108 <category>Selection</category> 0109 <description>Select all filenames that are selected in the active panel, also in the non-active panel</description> 0110 <command>%oSelect("%aList("selected", " ", "Yes")%")%</command> 0111 </action> 0112 </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 <!DOCTYPE KrusaderUserActions> 0118 <KrusaderUserActions> 0119 <action name="backup current" > 0120 <title>Backup in Current Directory</title> 0121 <tooltip>Backup in current folder</tooltip> 0122 <icon>document-save-as</icon> 0123 <category>System</category> 0124 <description same_as="tooltip" /> 0125 <command>%_Copy("%aCurrent%", "%_Ask("new name", "%aCurrent%.bak")%")%</command> 0126 <defaultshortcut>Shift+F5</defaultshortcut> 0127 </action> 0128 </KrusaderUserActions></programlisting> 0129 </para></listitem> 0130 0131 <listitem><para>Opens <link linkend="krusearcher">KruSearcher</link>: 0132 <programlisting> 0133 <!DOCTYPE KrusaderUserActions> 0134 <KrusaderUserActions> 0135 <action name="search" > 0136 <title>Search Test</title> 0137 <command>%_NewSearch("Search 2")%</command> 0138 </action> 0139 </KrusaderUserActions></programlisting> 0140 </para></listitem> 0141 0142 <listitem><para>Sets the selected picture as wallpaper: 0143 <programlisting> 0144 <!DOCTYPE KrusaderUserActions> 0145 <KrusaderUserActions> 0146 <action name="set wallpaper" > 0147 <title>Set as Wallpaper</title> 0148 <tooltip>Set as wallpaper</tooltip> 0149 <icon>image</icon> 0150 <category>Service Menu</category> 0151 <description>Set as wallpaper (scaled)</description> 0152 <command>dcop kdesktop KBackgroundIface setWallpaper "%aCurrent%" 6</command> 0153 <defaultshortcut>Win+W</defaultshortcut> 0154 </action> 0155 </KrusaderUserActions></programlisting> 0156 </para></listitem> 0157 0158 <listitem><para>This useraction edits a file with root permissions using <command>kdesu</command>: 0159 <programlisting> 0160 <!DOCTYPE KrusaderUserActions> 0161 <KrusaderUserActions> 0162 <action name="edit as root" > 0163 <title>Edit as Root</title> 0164 <tooltip>Edit as root</tooltip> 0165 <icon>kwrite</icon> 0166 <category>System</category> 0167 <description>Edit a file with root permissions using kdesu</description> 0168 <command>kdesu kwrite %aCurrent%</command> 0169 <defaultshortcut>Win+F4</defaultshortcut> 0170 </action> 0171 </KrusaderUserActions></programlisting> 0172 </para></listitem> 0173 0174 <listitem><para>This useraction Add item(s) to Amarok playlist: 0175 <programlisting> 0176 <!DOCTYPE KrusaderUserActions> 0177 <KrusaderUserActions> 0178 <action name="amarok enqueue" > 0179 <title>Enqueue in Amarok</title> 0180 <tooltip>Append selected item(s) to Amarok playlist</tooltip> 0181 <icon>amarok</icon> 0182 <category>Multimedia</category> 0183 <description same_as="tooltip" /> 0184 <command>amarok --append %aList("Selected")%</command> 0185 <defaultshortcut>Win+A</defaultshortcut> 0186 </action> 0187 </KrusaderUserActions></programlisting> 0188 </para></listitem> 0189 0190 <listitem><para>Opens <link linkend="synchronizer">Synchronizer</link>: 0191 <programlisting> 0192 <!DOCTYPE KrusaderUserActions> 0193 <KrusaderUserActions> 0194 <action name="synchronizer" > 0195 <title>Synchronizer</title> 0196 <command>%_Sync("Sync 2")%</command> 0197 </action> 0198 </KrusaderUserActions></programlisting> 0199 </para></listitem> 0200 0201 </itemizedlist> 0202 0203 </appendix>