[Thunar-dev] thunar custom actions menu grouping

Erlend Davidson E.R.M.Davidson at sms.ed.ac.uk
Thu Aug 23 18:03:47 CEST 2007



Aurélio A. Heckert wrote:
> On 8/23/07, Jelle de Jong <jelledejong at powercraft.nl> wrote:
>   
>> So why would we not simple use the existing freedesktop.org standard for
>> the *.desktop files and menus. 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. I think it is extremely important that
>> we use a very standard way of implementing a sub-menu, because this
>> increase the change that all other file managers out there, will also
>> support the sub-menu implementation.
>>
>> Best regards,
>>
>> Jelle
>>     
>
> Hi Jelle,
>
> I think you are giving the best way.
>
> Erlend Davidson make a good question about the pattern.
> But the desktop file specification has the solution. See:
> http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html
>   
That's a different specification: this is the spec for .desktop files in 
general; I think Jelle was referring to the Desktop Menu (i.e. xfdesktop 
right-click menu).  For the actions to be properly cross-filemanager 
they would need a specification of their own (of course they'd use the 
.desktop files and it would be very similar to the Desktop Menu spec), 
the most obvious reason for this is just knowing where to find the 
action .desktop files.

Benedict - what do you think?  Could this ever be an fdo specification?  
The advantage of a spec for this is interoperability between the file 
managers, but since the file managers tend to be connected to a desktop 
environment, with their own suite of programs
> MimeType : The MIME type(s) supported by this application.
>
> It is not equal to pattern, but it is better. An bash executable file
> can do not have a ".sh", but it's MIME Type is "application/x-sh" ;-)
>   
In the *nix world it is better - would be nice to have both, though not 
really necessary (if required one could set up their own mimetype).
> The edit interface can have a select list of knowed MIMEs to
> add for the list. The user don't must write that.
>   
With the ability to select more than one mimetype for each UCA.  How is 
best to do this (user-interface)?

I agree the best method for doing UCAs which would be more advanced than 
the current system (i.e. allowing sub-menus, which should indeed be 
implemented at some point) is .desktop files.  It allows someone to 
write packages which define actions (I have considered doing this: I 
wrote a photo-uploader for Facebook which I use but currently it's 
difficult to distribute).

Currently thunar knows how to parse an XML file (uca.xml).  In the 
meantime you could add another tag <category> and code thunar to use 
this.  Then implement a .desktop scheme (just like how the thunar 
thumbnailers work: 
http://thunar.xfce.org/documentation/C/customizing-thunar.html#thumbnailers) 
and write a simple parser which will read a directory of these and 
output uca.xml.




More information about the Thunar-dev mailing list