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

Re: Menu categories



Le Sun, Oct 21, 2007 at 07:20:22AM +0000, Sune Vuorela a écrit :
> Hi!
> 
> I have tried to make a script that converts desktop files into
> reasonable menu files.  My perl ability generally sucks, but I did
> something that at least worked. Thanks to people around various irc
> channels.

Dear Sune,

I think that your script can be very useful, not only for making a .menu entry
for programs, but also for managing .desktop and .menu entries for programs
which do not provide any, so that there is only one reference file.

In that case, the section would be decided in advance, and would not have to be
guessed. How about handling a X-Debian-Section field? It could even become a
way to resolve conversion problems, for instance one could "cat
'X-Debian-Section=Applications/Science/Debianolgy' >> example.deskotp' before
running your script in debian/rules...

Indeed, such a system may be needed because Desktop files often provide more
than one category, which correspond to different sections in the Debian menu.
In that case, one would need a way to choose, or maybe your program could
simply set priorities.

For instance :

sorbet【~】$ cat /usr/share/applications/treeviewx.desktop
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Terminal=false
Icon=treeviewx
Exec=tv
Name=TreeView X
GenericName=Tree Plotter
GenericName[en]=Tree Plotter
GenericName[fr]=Traceur d'arbres
GenericName[pt_BR]=Plotador de árvores
Comment=Displays, modifies, prints and exports in SVG format phylogenetic trees
Comment[en]=Displays, modifies, prints and exports in SVG format phylogenetic trees
Comment[fr]=Affiche, modifie, imprime et exporte au format SVG des arbres phyolgénétiques
Comment[pt_BR]=Exibe, modifica e exporta em formato SVG árvores filogenéticas
Type=Application
Categories=Biology;Science;Education;

sorbet【~】$ ./desktop2menu.pl /usr/share/applications/treeviewx.desktop
WARNING: Package not specified. Guessing package as: TreeView X
?package(TreeView X):\
        needs="X11"\
        section="Applications/Education"\
        title="TreeView X"\
        command="tv"\
        icon="/usr/share/pixmaps/treeviewx.xpm"\

Section could have been Applications/Science/Biology/ instead. (actually, that
is what I would have preferred).

I CCed the Debian-Med mailing list, because we have a few packages in which we
provide a .desktop file that we wrote in addition to the .menu file.

Have a nice day,

-- 
Charles Plessy
http://charles.plessy.org
Wako, Saitama, Japan



Reply to: