vim-gnome should install a .desktop file in /usr/share/applications

Bug #13409 reported by Andrew Conkling
26
Affects Status Importance Assigned to Milestone
vim (Ubuntu)
Fix Released
Low
Sebastien Bacher

Bug Description

Since gvim is an executable for X, there should be a .desktop file included in
/usr/share/applications, under Editors ;-P. I know there was one in Gentoo and
Mandrake which I've used in the past, so I don't know if one is provided
upstream or not.

Revision history for this message
Jeff Waugh (jdub) wrote :

We'd leave vim-gnome out of the main menus for the same reasons that we leave
emacs out - people who know they want it, know where it is, and we don't want to
clutter the menus with things that 'normal users' won't care about. The only
concession on this bug is that vim-gnome is a separate package, so wouldn't be
exposed to users by default. If you'd like to submit a patch, please go ahead.

Revision history for this message
Andrew Conkling (andrewski) wrote :

See, but neither is installed by default, so I think a different statement would
hold: if you have either one (gVim or xemacs) installed, you care about theme
and therefore want them there. In my case, I've uninstalled all other editors
and have only gvim, so a .desktop file would hardly be menu clutter....

As for submitting a patch, isn't the case that this .desktop file is excluded,
not that one must be created? I don't really know, but I'll look into it if
such is not the case....

Revision history for this message
Matt Zimmerman (mdz) wrote :

Er, emacs is in the menu :-)

Revision history for this message
Jeff Waugh (jdub) wrote :

Right, now that emacs is out of the desktop, we re-enabled the menu item.
There's no .desktop file in the vim-gnome package, so a patch would be required.

Revision history for this message
Ian Griffiths (ianrgriffiths) wrote :

Created an attachment (id=1496)
.desktop file for gvim

This is my first contribution to an open source project (gotta start somewhere
;-) ...so please be gentle.

anyway, I'm not sure what is wanted when you asked for a "patch" so I've
attached a .desktop file for Gvim. Its fairly similar to the Emacs one. The
icon used is provided by the "vim" package, so should be available.

Revision history for this message
Ian Griffiths (ianrgriffiths) wrote :

(From update of attachment 1496)
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Gvim
Comment=GVIM, graphical Vi IMproved
Exec=/usr/bin/gvim -f
TryExec=gvim
Terminal=false
Type=Application
Icon=/usr/X11R6/include/X11/pixmaps/vim.xpm
MimeType=text/plain;
Categories=Application;Utility;TextEditor;

Revision history for this message
Ian Griffiths (ianrgriffiths) wrote :

Created an attachment (id=1497)
updated .desktop file

sorry about the last comment...tried to do it the wrong way...

Here is an updated .desktop file. I just added in MimeType=text/plain

Revision history for this message
Andrew Conkling (andrewski) wrote :

Ian,
I think the following changes should be made:
Icon=gvim
Exec=gvim -f

Hard-coding icon paths is a theming no-no, because then any theme's provided
icon cannot be used. (I've filed a bug report about a number of Ubuntu packages
already.) And few of the Exec lines in .desktop files are hardcoded (none of
the Gnome packages I've seen).

Thanks for providing this; hopefully this bug can be resolved soon!

Revision history for this message
Ian Griffiths (ianrgriffiths) wrote :

Thanks for the suggestions Andrew,

Hard coding icon paths is a no-no for themeing, but there are no icons
provided for "vim" or "gvim" in the default themes (neither 'gnome' or
'human' has any as far as I could tell). So when I set Icon=gvim you
get a generic icon. I don't know if you can provide alternative icons
in the .desktop file so it could default to "gvim" but fall back to the
hard coded icon. Maybe I'm doing something wrong or missing something
here...

as for the Exec line, my understanding was that the TryExec=gvim would be
used if the Exec failed...again I might be missing something. But it's a
2 second job to change it if that is the prefered way.

Revision history for this message
Jeff Waugh (jdub) wrote :

Using a full path to the icon is fine; we'll fix it once there's a theme icon
for it. TryExec means "display this menu item if this executable exists". You
don't need it in this .desktop file.

Revision history for this message
Andrew Conkling (andrewski) wrote :

AFAIK, the application is supposed to install the icon into the hicolor
(fallback) theme. So, even if gvim were used as the Icon, the fallback icon
should be displayed. Perhaps the vim-gnome package is in need of some more
work, or perhaps I misunderstand how that works.

Revision history for this message
Ian Griffiths (ianrgriffiths) wrote :

Created an attachment (id=1580)
3rd attempt at .desktop file

Thanks for the correction Jeff, I've removed the line from the file.

I've left the hard coded icon path in there, and also added a '%U' to make gvim
open the file dropped onto the icon.

The vim-gnome package might be in need of a little love Andrew, but even so I'd
like to see this bug get fixed soon, so there can at least be an icon in the
menu for the hoary release. Then the icon theme stuff can get fixed later.

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 14501 has been marked as a duplicate of this bug. ***

Revision history for this message
Andrew Conkling (andrewski) wrote :

OK, I've made a rather complete .desktop file, going off of one I found in Red
Hat's bugzilla for the translations.
For the record, Icon=gvim works with the default Gnome theme; the .xpm is used
as the fallback icon. I don't understand why it must be hardcoded.

In any case, any chance this can be resolved before Hoary is released?

Revision history for this message
Andrew Conkling (andrewski) wrote :

Created an attachment (id=1933)
.desktop file with translations

Here's the .desktop file.

Revision history for this message
Ian Griffiths (ianrgriffiths) wrote :

OK the Icon=gvim works here now as well (I'm using the 'Human' theme). It didn't
before...
I'm pretty certain I tried when you suggested it be changed from hard coded.

Nice work with the translations ;-)

As for getting this out before the hoary release...It would be preferable to get
it in
for hoary, but if it doesn't make it in what are the chances of getting it into
the hoary
packages *after* the release?

Revision history for this message
Matt Zimmerman (mdz) wrote :

I see no problem adding this to Hoary, but it must be done by the end of this week.

Revision history for this message
Jeff Waugh (jdub) wrote :

I had a quick look at this, but the vim package is relatively bongtastic ->
gvim.desktop arrives in the vim-gtk package, and is called vim-variant.desktop
in the debian source. But there's no .desktop file in the vim-gnome package, and
if you added a vim-gnome.desktop file to it, you'd end up having two menu
entries if you had vim-gtk and vim-gnome installed. Perhaps that's not a
terribly bad thing, it just seems entirely redundant.

Revision history for this message
Jeff Waugh (jdub) wrote :

Hrm, perhaps it should go in a common vim package and include a
TryExec=/usr/bin/gvim line?

Revision history for this message
Andrew Conkling (andrewski) wrote :

Well, you can't have vim-gnome and vim-gtk (or vim-python) installed at the same
time anyway; they conflict. So, technically, you'd have to add it to them...
and vim-perl, and vim-tcl. So, you could just add gvim.desktop (assuming gvim
is the executable name for all of them) and be done with it. Kind of a silly
way to implement bindings for languages (what if you program Python AND Perl?),
but anyway.... :-)

Revision history for this message
Sebastien Bacher (seb128) wrote :

*** Bug 18737 has been marked as a duplicate of this bug. ***

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

*nag*

I still see no menu icon for gvim

Revision history for this message
Hezekiah Carty (hez) wrote :

Has this situation been resolved? What further work is required to add a (proper) gvim icon to the menu?

Revision history for this message
Sebastien Bacher (seb128) wrote :

No it has not been fixed, somebody working with the Debian maintainers of vim to fix that would be nice

Revision history for this message
Andrew Conkling (andrewski) wrote :

In Dapper, vim-gui-common has a desktop file in /usr/share/applications. Whee!

Changed in vim:
status: Unconfirmed → Fix Committed
Changed in vim:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.