![]() | useraction.xml |
Prev |
This appendix gives several examples of useraction.xml files. By this way you can start do discover the power of the useractions and start learning to use them. If you have made a great useraction please send it in, we are planning to collect useractions on our website and are planning to ship Krusader with several great Useractions in the near future. Once you understand how to write useractions you find that Krusader is a very powerfull customizable tool.
Runs uptime
<!DOCTYPE KrusaderUserActions> <KrusaderUserActions> <action name="uptime" > <title>uptime</title> <tooltip>tells how long the computer is already running</tooltip> <icon>clock</icon> <category>information</category> <description same_as="tooltip" /> <command executionmode="collect_output" >uptime</command> <defaultshortcut>Alt+Ctrl+U</defaultshortcut> </action> </KrusaderUserActions>
Runs ls -l
<!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>
Echo Placeholder
<!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>
This useraction copies current path and filename to clipboard:
<!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>
Selects .diff and *.h in the active panel:
<!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>
Active panel changes to mnt/floppy (bookmark):
<!DOCTYPE KrusaderUserActions> <action name="mnt/floppy bookmark" > <title>jumps to /mnt/floppy</title> <category>Bookmarks</category> <command>%aGoto("/mnt/floppy", "yes")%</command> </action> </KrusaderUserActions>
Selects every filename that is selected in the active panel also in the non-active panel:
<!DOCTYPE KrusaderUserActions> <action name="asdfasdf" > <title>select in other panel</title> <category>Selection</category> <description>Selects every filename that is selected in the active panel also in the non-active panel</description> <command>%oSelect("%aList("selected", " ", "Yes")%")%</command> </action> </KrusaderUserActions
Makes a backup of the current file/folder to foo.bak into the current directory:
<!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>
Opens KruSearcher:
<!DOCTYPE KrusaderUserActions> <KrusaderUserActions> <action name="search" > <title>search testlt;/title> <command>%_NewSearch("Search 2")%</command> </action> </KrusaderUserActions>
Sets the selected picture as wallpaper:
<!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>
This useraction edits a file with root permissions using kdesu:
<!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 kdesu</description> <command>kdesu kedit %aCurrent%</command> <defaultshortcut>Win+F4</defaultshortcut> </action> </KrusaderUserActions>
This useraction Add item(s) to Amarok playlist:
<!DOCTYPE KrusaderUserActions> <KrusaderUserActions> <action name="amarok enqueue" > <title>Enqueue in Amarok</title> <tooltip>Add item(s) to Amarok playlist</tooltip> <icon>amarok</icon> <category>Multimedia</category> <description same_as="tooltip" /> <command onmultiplefiles="call_each" >dcop amarok player addMedia %aCurrent%</command> <defaultshortcut>Win+A</defaultshortcut> </action> </KrusaderUserActions>
Opens KruSyncDir:
<!DOCTYPE KrusaderUserActions> <KrusaderUserActions> <action name="synchronizer" > <title>synchronizer</title> <command>%_Sync("Sync 2")%</command> </action> </KrusaderUserActions>
Prev | Home | |
Configuration files | Up |