FS#53431 - [vim] vim.desktop file is removed

Attached to Project: Arch Linux
Opened by Dany Marcoux (vok5) - Thursday, 23 March 2017, 21:57 GMT
Last edited by Levente Polyak (anthraxx) - Monday, 26 February 2018, 22:46 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No


Description: The vim.desktop file is provided by upstream(1), but it is removed during installation(2,3). As stated in the Arch Wiki(4): A package which does not include a .desktop file or icons or other freedesktop stuff. This is not a bug if such files are not included in the source tarball, and this must be requested as a feature request upstream. If such files are provided by upstream but not used in the package then this is a bug.

1: https://github.com/vim/vim/blob/master/runtime/vim.desktop
2: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/vim#n175
3: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/vim#n212
4: https://wiki.archlinux.org/index.php/Reporting_bug_guidelines#Reasons_for_not_being_a_bug
This task depends upon

Closed by  Levente Polyak (anthraxx)
Monday, 26 February 2018, 22:46 GMT
Reason for closing:  Implemented
Additional comments about closing:  8.0.1542-2
Comment by Doug Newgard (Scimmia) - Monday, 27 March 2017, 17:08 GMT
What is the use case for this .desktop file?
Comment by Dany Marcoux (vok5) - Monday, 27 March 2017, 20:49 GMT
A desktop file describes how a particular program is to be launched, how it appears in menus, etc... (See this link for the complete specification: https://standards.freedesktop.org/desktop-entry-spec/latest/)

As for vim, this file could be used to set vim as the default application for all file/mime types specified here: https://github.com/vim/vim/blob/master/runtime/vim.desktop#L81

On top of this, vim could also be set as the default application for other file/mime types. This is done through a variety of ways as described in the following link, the most common one being xdg-open: https://wiki.archlinux.org/index.php/Default_applications#Utilities

The last part is the most important one as it allows users to customize their setup. One case I have for example, I want to tell my file manager (ranger) to launch vim for specific files/mime types (Markdown files for example, but it could be any file type). Without this file, I cannot do this. I would need to create this file, but I shouldn't have to as it is already provided and maintained by upstream.
Comment by Eli Schwartz (eschwartz) - Monday, 27 March 2017, 21:04 GMT
Well, now you're just being ridiculous. I am 100% positive that Scimmia knows what desktop files in the general sense do... let me reiterate his question with emphasis applied:

What is the use case for *THIS* .desktop file?

Keep in mind that the gvim package already installs a desktop file for gvim. Because gvim, being a graphical version of vim, has a graphical launch aspect. It makes no sense, however, to install a desktop file for launching the CLI-only vim executable, since the desktop spec is intended for, well, desktops.

Please file an upstream bug requesting the removal of that illogical desktop file. :p
Comment by Dany Marcoux (vok5) - Tuesday, 28 March 2017, 07:17 GMT
I totally got the question right the first time. I don't personally know Scimmia, so I simply wanted to be sure that we are on the same page. So please, let's avoid calling others ridiculous or whatever. I don't see how it brings any value to the discussion.

Anyway, the desktop spec is indeed intended to be used, in most cases, inside desktop environments. Not having a desktop environment doesn't mean that one doesn't have a use for desktop files. Desktop files have a Terminal property, which implies that it could also be used to launch applications inside a terminal. This property is set to True for the vim.desktop file: https://github.com/vim/vim/blob/master/runtime/vim.desktop#L75.

I already give a use case example in my first comment, but I realize that it is perhaps not so clear. I use a file manager (ranger) which runs in a terminal. Whenever I open a file in ranger, I want to be able to open it with the default application associated to its mime type. In ranger, it could be done this way: https://wiki.archlinux.org/index.php/ranger#File_association. It could be any application, a terminal or graphical one. Some people could want to use vim, gvim or whatever they prefer. This is why I believe having the vim.desktop file would be useful.