
132
|
Chapter 5, KDE Desktop
#40 Create Your Own KDE Right-Click Menu Actions
HACK
Symbols Available for Menu Actions
Konqueror passes the names of selected URLs, selected files, and other
selected elements to your custom menu actions through the use of symbols.
Symbols exist for single files, multiple files, single URLs, and more. The
right-click action that allows you to change a file to be executable works,
because it substitutes the name of the selected file for the symbol
%f. Here
are some other symbols available to you, and how they work.
%f
A single filename, even if you select multiple files. In general, you use
this only when you intend to select a single file. In some cases, you can
use this to select several files for use by a program that knows how to
launch a separate instance for each filename.
%F
Multiple selected files. Use this for programs that can act upon several
files at once.
%u
A single URL.
%U
Multiple URLs.
%d
The single directory that contains the selected file represented by %f.
%D
A list of the same directory containing an entry for every selected file in
that directory (
%F).
%n
A filename without a path.
%N
Multiple filenames without paths.
%k
A file represented as a URI.
Create an Action to Jump-Start Script Writing
Here’s another hack to give you a taste of some of the power behind KDE
custom menus. This time, you will exploit three powerful features of KDE.
The first is the ability