Re: .desktop



2009/11/24 Chmouel Boudjnah <chmouel chmouel com>:
> Hi Ulrik,
>
> So maybe I confuse but it does not seems to parse those for me the from code :
>
> In [13]: cat /home/chmouel/Desktop/Thunderbird.desktop
> #!/usr/bin/env xdg-open
>
> [Desktop Entry]
> Encoding=UTF-8
> Version=1.0
> Type=Application
> Terminal=false
> Icon[en_GB]=gnome-panel-launcher
> Name[en_GB]=Thunderbird
> Exec=/opt/thunderbird/thunderbird
> Name=Thunderbird
> Icon=/home/chmouel/Photos/Icons/icon_thunderbird.png
>
> In [14]: 'thunderbird' in [ x.get_name().lower() for x in
> gio.app_info_get_all() ]
> Out[14]: False
>
> am I looking on the wrong part of the code ?

What does Kupfer do in this situation? What are you trying to do?

gio.app_info_get_all() returns all programs installed in the standard
paths, it does not scour the whole filesystem.

Kupfer finds programs in two contexts

(1)  Applications plugin -- calls gio.app_info_get_all() and is
exactly what we want --all installed programs in standard paths. If
you want applications here, add them to /usr/share/applications or
~/.local/share/applications . It's simple and great.

(2) Directory sources -- when looking through directories, like
~/Desktop, Kupfer will call ConstructFileLeaf (objects.py   called
from line 880. Defined on line 312). This function checks if it's a
desktop file, and tries to parse it as an application -- it calls into
AppLeaf, which on line 379 uses gio.unix.DesktopAppInfo to parse a
desktop file.

This way, ~/Desktop/thunderbird.desktop should be parsed and read if
~/Desktop is a catalog in Kupfer. However, it won't replace any
program found with method (1), it might even look like a duplicate
(don't duplicate, name your desktop version differently). If you want
to override the installed program, install the .desktop file in the
locations mentioned in (1).

ulrik


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]