[Thunar-dev] thunar custom actions menu grouping

Erlend Davidson E.R.M.Davidson at sms.ed.ac.uk
Thu Aug 23 11:40:36 CEST 2007

Jelle de Jong wrote:
> Erlend Davidson wrote:
>> Jelle de Jong wrote:
>>> Jelle de Jong wrote:
>>>> I have been thinking about this problem quite a while now.
>>>> I want to use freedesktop.org *.desktop standardisation files to
>>>> integrate scripts in the right menu of the great Thunar file manager.
>>>> Wouldn't it be great to have this functionality?
>>>> I have around 30 self made scripts integrated into Thunar. The problem
>>>> is they are not grouped nicely in categories. I would like to be able to
>>>> create sub menu's to sort the scripts.
>>>> I think the standard *.desktop files can be used for this, just like in
>>>> the application menu's. We can probably keep the current configure
>>>> custom action system. Only let Thunar scan the files that are in the
>>>> actions list. When these files are of the .desktop format then read them
>>>> and change the menu structure depending on the contains. I only don´t
>>>> know how the argument passing should go.
>>>> Would somebody be willing to investigate this idea and maybe realise it?
>>>> Best regards,
>>>> Jelle
>>> Hello everybody,
>>> I have sent this mail some time ago, but nobody replied on the mail. How
>>> should I deal with this? Does nobody want sub-menus in the thunar file
>>> manager?
>> Well I think Aurelio's SVN plugin also needs it.  I think it is a good 
>> idea, I wonder if it is possible with proper extensions (as opposed to 
>> UCA's)?  The trouble with putting it in UCA is that it will complicate 
>> things quite a lot: also on the user-interface side.
> So why would we not simple use the existing freedesktop.org standard for
> the *.desktop files and menus.
This one (for the )?

The trouble is it has no way of displaying a menuitem conditionally.  
The current implementation for UCA involves a file 
~/.config/Thunar/uca.xml.  This has <pattern></pattern> for each action, 
so that thunar knows when to display it.  There's no equivalent of this 
in the desktop menu spec (because it was never intended to be triggered 
on a file).

Also the Desktop Menu spec states the location the .desktop files should 
be kept: we can't store ours there or they'll mess up the real desktop menu.
>  It is documented and proven to work. Just
> make a script folder in the users Thunar preference folder in its home
> directory. Then scan this directory for the *.desktop files and build
> the sub-menu for Thunar. The menu information can be cached so
> performance loss will be minimal.
That specification for the desktop menu includes caching to an XML file.
>  I think it is extremely important that
> we use a very standard way of implementing a sub-menu, because this
> increase the chance that all other file managers out there, will also
> support the sub-menu implementation.
Using .desktop files might be a good idea, but for it to be widely 
adopted the layout of the file (locations etc) would have to be made a 
standard by the freedesktop.org.  That's not easy to do.  You'd need a 
standard for "Conditional Right-click Menus".  It could be very similar 
to the Desktop Menu spec except for:
1. different file locations (e.g. /usr/share/applications-conditional 
and another one under ~/.)
2. something in the .desktop file to specify when the menuitem is to be 

More exceptions might come up, especially in discussion with other 
file-managers who'll have different needs.


More information about the Thunar-dev mailing list