From b5ea0b0fb9eb57f2878007d2899682dacbc816d6 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sun, 18 Dec 2011 22:08:28 +0100 Subject: desktop-entry: Restore support for Desktop Actions Reintroduce the Actions key, which was removed around version 1.1, and give it a formal specification, detailing what actions applications are expected to provide and who should make use of this information. Names were taken from the original specification, since apparently they have been in use during all this time. Also remove X-KDE-* keys from the example, as it's unrelated to the spec. --- desktop-entry/desktop-entry-spec.xml | 130 ++++++++++++++++++++++++++++++++++- 1 file changed, 127 insertions(+), 3 deletions(-) (limited to 'desktop-entry') diff --git a/desktop-entry/desktop-entry-spec.xml b/desktop-entry/desktop-entry-spec.xml index 01638e6..bb32e10 100644 --- a/desktop-entry/desktop-entry-spec.xml +++ b/desktop-entry/desktop-entry-spec.xml @@ -507,6 +507,18 @@ NO 1 + + Actions + + Identifiers for application actions. This can be used to tell the + application to make a specific action, different from the default + behavior. The Application actions + section describes how actions work. + + string(s) + NO + 1 + MimeType @@ -860,6 +872,110 @@ application/x-bar=bar.desktop; --> + + Additional applications actions + + Desktop entries of type Application can include one or more actions. An + action represents an additional way to invoke the application. + Application launchers should expose them to the user (for example, as a + submenu) within the context of the application. This is used to build + so called "Quicklists" or "Jumplists". + + + Application actions should be supported by implementors. However, in + case they are not supported, implementors can simply ignore the + Actions key and the associated Desktop + Action action groups, and keep using the Desktop + Entry group. Therefore, the primary way to invoke the application + should be through the main Exec line, as well as the primary Name and Icon. + + + Also, it is not expected that other desktop components showing app lists + (eg. software installers) will provide any UI for these actions, therefore + applications must only include actions that make sense as general launchers. + + + Each action action is identified by a string, following the same rules + as key names (see ). Each identifier is associated + with an action group that must be present in the .desktop + file. The action group is a group named Desktop Action %s, + where %s is the action identifier. + + + It is not valid to have an action group for an action identifier not + mentioned in the Actions key. Such an action group + must be ignored by implementors. + + + The following keys are supported within each action group. If a + REQUIRED key is not present in an action group, then the implementor + should ignore this action. + + + Action group keys + + + + Key + Description + Value Type + REQ? + + + + + Name + + The label that will be shown to the user. Since actions will be + always shown in the context of a specific application (that is, as + a submenu of a launcher), this only needs to be unambiguous within + one app and should not include the application name. + + localestring + YES + + + Exec + + Program to execute for this action, possibly with arguments. See the Exec key for details on how this key works. + + string + YES + + + Icon + + The icon to be shown togheter with the action. If the name is + an absolute path, the given file will be used. If the name is not + an absolute path, the algorithm described in the Icon + Theme Specification will be used to locate the icon. + A string to be interpreted as [Desktop Entry]/Icon, that is, + according to the icon theme. Implementations may choose to ignore it. + + string + NO + + + + OnlyShowIn, NotShowIn + + + A list of strings to be interpreted according to the Desktop + Menu Specification, but affect only the visibility of + the specific action. These are to be interpreted in addition to, + and not to replace, the keys in the main group with the same + name. + + string(s) + NO + + + +
+
Extending the format @@ -893,9 +1009,17 @@ TryExec=fooview Exec=fooview %F Icon=fooview MimeType=image/x-foo; -X-KDE-Library=libfooview -X-KDE-FactoryName=fooviewfactory -X-KDE-ServiceType=FooService +Actions=Gallery;Create; + +[Desktop Action Gallery] +Exec=fooview --gallery +Name=Browse Gallery + +[Desktop Action Create] +Exec=fooview --create-new +Name=Create a new Foo! +Icon=fooview-new + Currently reserved for use within KDE -- cgit v1.2.3-70-g09d2