1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
<appendix id="useraction-xml">
<!-- **********************************************************************
installation.docbook
++++++++++++++++++++++++++
copyright : (C) 2000 - 2008
Rafi Yanai, Shie Erlich, Frank Schoolmeesters
& the Krusader Krew
e-mail : [email protected]
web site : http://www.krusader.org
description : a Krusader Documentation File
***************************************************************************
* Permission is granted to copy, distribute and/or modify this *
* document under the terms of the GNU Free Documentation License, *
* Version 1.1 or any later version published by the Free Software *
* Foundation; with no Invariant Sections, no Front-Cover Texts and *
* no Back-Cover Texts. A copy of the license is available on the *
* GNU site http://www.gnu.org/licenses/fdl.html or by writing to: *
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
* MA 02110-1301, USA. *
*********************************************************************** -->
<title>useraction.xml</title>
<para>This appendix gives several examples of
<filename>useraction.xml</filename> files. With this you can begin
to discover the power of the &useractions-lnk; and
start learning how to use them. Once you understand how to write
UserActions you will find that &krusader; is an even
more powerful, customizable tool.</para>
<para>Please consider uploading your UserActions at
&kde-files-url; as we are collecting them. If your
UserAction is selected by us it will be shipped with
&krusader; at the next release. We provide also an
&useractionsforum-url;.</para>
<itemizedlist>
<listitem><para>Runs <command>uptime</command>
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="uptime" >
<title>Up-time</title>
<tooltip>tells how long since the computer has been booted</tooltip>
<icon>clock</icon>
<category>information</category>
<description same_as="tooltip" />
<command executionmode="collect_output" >uptime</command>
<defaultshortcut>Alt+Ctrl+U</defaultshortcut>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>Runs <command>ls -l</command>
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="ls -l" >
<title>ls -l in curremt dir</title>
<description same_as="tooltip" />
<command executionmode="collect_output" >ls -l %aPath% %oPath%</command>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>Echo Placeholder
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="test_placeholder" >
<title>Echo Placeholder</title>
<tooltip>Echo's the placeholder values</tooltip>
<category>Testing</category>
<description same_as="tooltip" />
<command executionmode="collect_output" onmultiplefiles="call_each" >echo -e "aPath %aPath()% \naCurrent: %aCurrent()%"</command>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>This useraction copies current path and filename to clipboard:
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="clipboard current" >
<title>Copy to Clipboard</title>
<tooltip>Copy to clipboard</tooltip>
<icon>klipper</icon>
<category>System</category>
<description>Copy current path and filename to clipboard</description>
<command>%_Clipboard("%aCurrent%")%</command>
<defaultshortcut>Win+C</defaultshortcut>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>Selects <literal role="extension">.diff</literal> and <literal role="extension">*.h</literal> in the active panel:
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="test_select" >
<title>Add selection *.diff and *.h</title>
<category>Selection</category>
<command>%aSelect("*.diff", "add")% %aSelect("*.h", "add")%</command>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>Active panel changes to <filename>mnt/floppy</filename> (bookmark):
<programlisting>
<!DOCTYPE KrusaderUserActions>
<action name="mnt/floppy bookmark" >
<title>Jump to /mnt/floppy</title>
<category>Bookmarks</category>
<command>%aGoto("/mnt/floppy", "yes")%</command>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>Select in the non-active panel, all filenames that are highlighted in the active panel:
<programlisting>
<!DOCTYPE KrusaderUserActions>
<action name="asdfasdf" >
<title>Select in Other Panel</title>
<category>Selection</category>
<description>Select all filenames that are selected in the active panel, also in the non-active panel</description>
<command>%oSelect("%aList("selected", " ", "Yes")%")%</command>
</action>
</KrusaderUserActions</programlisting>
</para></listitem>
<listitem><para>Make a backup of the current file/folder to <filename>foo.bak</filename> into the current directory:
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="backup current" >
<title>Backup in Current Directory</title>
<tooltip>Backup in current directory</tooltip>
<icon>filesaveas</icon>
<category>System</category>
<description same_as="tooltip" />
<command>%_Copy("%aCurrent%", "%_Ask("new name", "%aCurrent%.bak")")%</command>
<defaultshortcut>Shift+F5</defaultshortcut>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>Opens <link linkend="krusearcher">KruSearcher</link>:
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="search" >
<title>Search Test</title>
<command>%_NewSearch("Search 2")%</command>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>Sets the selected picture as wallpaper:
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="set wallpaper" >
<title>Set as Wallpaper</title>
<tooltip>Set as wallpaper</tooltip>
<icon>image</icon>
<category>Service Menu</category>
<description>Set as wallpaper (scaled)</description>
<command>dcop kdesktop KBackgroundIface setWallpaper "%aCurrent%" 6</command>
<defaultshortcut>Win+W</defaultshortcut>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>This useraction edits a file with root permissions using <command>tdesu</command>:
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="edit as root" >
<title>Edit as Root</title>
<tooltip>Edit as root</tooltip>
<icon>kwrite</icon>
<category>System</category>
<description>Edit a file with root permissions using tdesu</description>
<command>tdesu kedit %aCurrent%</command>
<defaultshortcut>Win+F4</defaultshortcut>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>This useraction Add item(s) to Amarok playlist:
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="amarok enqueue" >
<title>Enqueue in Amarok</title>
<tooltip>Append selected item(s) to Amarok playlist</tooltip>
<icon>amarok</icon>
<category>Multimedia</category>
<description same_as="tooltip" />
<command>amarok --append %aList("Selected")%</command>
<defaultshortcut>Win+A</defaultshortcut>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
<listitem><para>Opens <link linkend="synchronizer">Synchronizer</link>:
<programlisting>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
<action name="synchronizer" >
<title>Synchronizer</title>
<command>%_Sync("Sync 2")%</command>
</action>
</KrusaderUserActions></programlisting>
</para></listitem>
</itemizedlist>
</appendix>
|