Hi Eugene,
I've tried with xdg-* commands and I could associate the application
with files, but I still can't open the application by double clicking
on a file.
To run my application I execute a bash script which could receive a
parameter. So in the file "application.desktop" I've the line:"Exec=/
home/user/.local/bin/myapp.sh %f"
And when I look the properties of any of the file that application
generates (after associate the application to them) the command line
to execute when receive a double click is "/home/user/.local/bin/
myapp.sh" (note that there isn't "%f")
I found differences between associate the application with xdg-mime
command and when I associate the application from file's properties:
1)_ When I associate the application from file's properties and edit
the command line that must execute on double click by adding the "%f",
the file "userapp-myapplicationnaem.sh-DS..x.desktop" is automatically
generated. This file is equal to application.desktop except for this:
"Exec=/home/user/.local/bin/myapp.sh %f %f"
2)_ the file mimeapps.list is generated automatically in /home/
user/.local/share/application. It's equal to defaults.list but after
equal sign ("=") it makes reference to "userapp-myapplicationnaem.sh-
DS..x.desktop"
Any idea?
Thanks again.
Alejandro.
On Apr 28, 3:54 pm, Eugene Zolenko <
zolen...@gmail.com> wrote:
> So it seems like you registered mime type properly, but your desktop file is
> not installed correctly or doesn't declare it can handle mime type properly.
>
> Which distribution/desktop are you testing on and what kind of file is it?
> Some versions of gnome tried to be way too smart for their own good and were
> overriding file associations based on results of a scan. So if a file is a
> zip with renamed extension and supposed to have a special app to open it,
> gnome would detect that it really is an archive and open it in whatever app
> opens zip files on gnome.
>
> I use xdg-desktop-menu to install .desktop files (because autopackage API
> can't create sub-menus). You can try that.
>
> On Ubuntu 10 xdg-desktop-menu (and I would expect autopackage code too)
> doesn't work properly (needs to call update-gnome-menus-cache). But I'm not
> sure if that affects file associations at all.
>
> BTW, did you try forcing you app to be default handler? Install mime type,
> then install desktop file, then run:
> xdg-mime default app.desktop mimetype
>
> On Wed, Apr 28, 2010 at 8:41 AM, alejandro <
ahmosto...@gmail.com> wrote:
> > Hi Eugene, and thanks for answer again.
> > I've tried to install mime types using xdg-mime and it works, better
> > than that, it helped me to correct the application.xml file. But my
> > real problem is how to associate my application with that mime type,
> > that is what I can't make.
> > When I use the ".package" it change the mime type of files, but
> > doesn't associate the application with them.
> > I don't know where trouble could be.
>
> > I was reading some pages (man, web, etc) and saw that there is a
> > command, like update-mime-database, "update-desktop-database" which
> > must be run after install a .desktop file. (see
>
> >
http://library.gnome.org/admin/system-admin-guide/stable/mimetypes-re...
> > ).