The "Desktop Action" entry is not parsed in .desktop files. This feature is required to add Unity-like actions on right-click in XFCE launchers. Maybe it would be better to improve GIO's GDesktopAppInfo parser and use it instead of XFCE4Util.
Agree. This feature is implemented in KDE, Unity, Dockbarx and Cinnamon. Example (Actions on right click: play, puase, stop) /usr/share/applications/clementine.desktop looks like: [Desktop Entry] Version=1.0 Type=Application Name=Clementine GenericName=Clementine Music Player GenericName[pl]=Odtwarzacz muzyki Clementine GenericName[pt]=Reprodutor de músicas Clementine Comment=Plays music and last.fm streams Comment[pl]=Odtwarzanie muzyki i strumieni last.fm Comment[pt]=Reprodução de músicas e emissões last.fm Exec=clementine %U TryExec=clementine Categories=AudioVideo;Player;Qt; ... [Play Shortcut Group] Name=Play Exec=clementine --play TargetEnvironment=Unity Name[af]=Speel Name[be]=Прайграць .... [Pause Shortcut Group] Name=Pause Exec=clementine --pause TargetEnvironment=Unity Name[pl]=Pauza Name[ru]=Приостановить .... [Stop Shortcut Group] Name=Stop Exec=clementine --stop TargetEnvironment=Unity Name[br]=Paouez Name[ru]=Остановить
Created attachment 6155 Added support for desktop actions
Please review the patch.
Hi, Before, I was a fan of this feature, but then understood that these just was wrong thought, or at least badly implemented. Following the example of Clementine. What sense does display the "play" option, if clementine really is playing music, or if playlist is empty? What sense does display the "pause" option, if not playing music.? What sense does display the "next" option, if there is no any next song? The worst part is: What sense does any of these options if clementine is not running?. So, in general I think it is a misuse of the developers add these options to a music player but unfortunately it was the example used in ubuntu. :S For these actions that depend on the state of the programs should not use static actions. We need to define another standard with dbus. A good example of static action would be: "Open file", "Open CD audio", "Add podcasd" or "Add streaming". Functions that are independent of the status of the player, and in any case, can open the player and do the actions. Regards, Matias. p.s: I started writing to avoid implement this feature, but second thought, the characteristic is good. Just is that there is an abuse of the developers. So, +1. No tested but the patch looks good. =)
To be honest, I've implemented this feature mostly to be able to use the "Open new window in incognito mode" action in Chromium and the "Text document" action in LibreOffice, which seems to be very useful and time-saving to me. I've even added suppport of non-standart "X-Ayatana-Desktop-Shortcuts" entry for that case. P. S. There already is a D-Bus interface for the media players. http://specifications.freedesktop.org/mpris-spec/latest/ See also: https://launchpad.net/ubuntu/+source/indicator-sound
> To be honest, I've implemented this feature mostly to be able to use the "Open > new window in incognito mode" action in Chromium and the "Text document" action > in LibreOffice. Yes. These are excellent examples of a good use of the feature. and for this +1 to the addition of your patch. The abuse of the characteristic is another discussion and irrelevant to this bug. Sorry for starting this discussion. ;) > I've even added suppport of non-standart "X-Ayatana-Desktop-Shortcuts" entry > for that case. Please. No. Even ubuntu apps are migrating to the implementation of freedektop. So is preferable wait until chromium migrate. =) > P. S. There already is a D-Bus interface for the media players. > http://specifications.freedesktop.org/mpris-spec/latest/ > See also: https://launchpad.net/ubuntu/+source/indicator-sound Yes.. I know it well: https://github.com/matiasdelellis/libmpris2client =) However we need something more generic, because the music players are not the only ones who need dynamic actions. Ubuntu also has a good implementation, but is not yet standard. Regards. Matias.
Created attachment 6160 Minor fix for garcon_menu_item_reload_from_file There was a little bug in garcon_menu_item_reload_from_file.
Simon, Sean, opinion on this ?
Thanks for these patches. I squashed them and merged them to master in: commit aec77533132eb324180ef771e15226a752573eae Author: Danila Poyarkov <dannotemail@gmail.com> Date: Wed Jun 1 19:55:22 2016 +0300 Added desktop actions support (bug #11268) * Minor changes by Eric, mostly dropping the changes to the test-display-menu since it has changed and fixing a couple g_return_if_fail macros which needed to be g_return_val_if_fail. Signed-off-by: Eric Koegel <eric.koegel@gmail.com> http://git.xfce.org/xfce/garcon/commit/?id=aec77533132eb324180ef771e15226a752573eae A couple commits later, I added it as an option to the garcon-gtk menu so it will show up on the xfce4-panel if configured and added custom icon support for desktop actions. Several applications like Parole support it. Thanks again!