Aller au contenu principal

Actions du lanceur d'applications sur le bureau

Vue d'ensemble​

Sur de nombreux environnements Linux, vous pouvez ajouter des entrées personnalisées à son lanceur d'application en modifiant le fichier .desktop. For details, see the freedesktop.org Desktop Entry Specification.

Pour créer un raccourci, vous devez fournir les propriétés Name et Exec pour l'entrée que vous voulez ajouter au menu de raccourci. The desktop will execute the command defined in the Exec field after the user clicks the shortcut menu item. Un exemple du fichier .desktop peut ressembler à ceci :

Actions=PlayPause;Next;Previous

[Desktop Action PlayPause]
Name=Play-Pause
Exec=audacious -t

[Desktop Action Next]
Name=Next
Exec=audacious -f

[Desktop Action Previous]
Name=Previous
Exec=audacious -r

The preferred way for the desktop to instruct your application on what to do is using parameters. You can find them in your application in the global variable process.argv.