docs: revised linux desktop actions page (#26118)

This commit is contained in:
Antonio 2020-10-26 22:32:20 +02:00 committed by GitHub
parent 4be10523e8
commit e512669937
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,17 +1,21 @@
# Custom Linux Desktop Launcher Actions
On many Linux environments, you can add custom entries to its launcher
by modifying the `.desktop` file. For Canonical's Unity documentation,
see [Adding Shortcuts to a Launcher][unity-launcher]. For details on a
more generic implementation, see the [freedesktop.org Specification][spec].
## Overview
__Launcher shortcuts of Audacious:__
On many Linux environments, you can add custom entries to the system launcher
by modifying the `.desktop` file. For Canonical's Unity documentation, see
[Adding Shortcuts to a Launcher][unity-launcher]. For details on a more generic
implementation, see the [freedesktop.org Specification][spec].
![audacious][audacious-launcher]
Generally speaking, shortcuts are added by providing a `Name` and `Exec`
property for each entry in the shortcuts menu. Unity will execute the
`Exec` field once clicked by the user. The format is as follows:
> NOTE: The screenshot above is an example of launcher shortcuts in Audacious
audio player
To create a shortcut, you need to provide `Name` and `Exec` properties for the
entry you want to add to the shortcut menu. Unity will execute the command
defined in the `Exec` field after the user clicked the shortcut menu item.
An example of the `.desktop` file may look as follows:
```plaintext
Actions=PlayPause;Next;Previous
@ -32,8 +36,8 @@ Exec=audacious -r
OnlyShowIn=Unity;
```
Unity's preferred way of telling your application what to do is to use
parameters. You can find these in your app in the global variable
The preferred way for Unity to instruct your application on what to do is using
parameters. You can find them in your application in the global variable
`process.argv`.
[unity-launcher]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher