dist: runtime/nvim.desktop

Closes #3689

cmake: Add `desktop-install` and `icon-install` targets. `runtime`
target will trigger them.

Specification:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys

Icons are stored system-wide in /usr/share/applications or user wide at
/usr/share/icons/hicolor/scalable/apps and can be overriden in ~/.local/share/icons

nvim.desktop file can be installed system wide or in
~/.local/share/applications/

To test without an installer:
$ xdg-desktop-menu install --novendor runtime/nvim.desktop
$ xdg-icon-resource install --novendor --mode user --size 64 contrib/nvim-icon.png

Once it is installed, you can test with gtk-launch if installed or
dmenu/rofi (drun mode)
This commit is contained in:
Matthieu Coudron 2017-01-24 16:11:21 +01:00 committed by Justin M. Keyes
parent bdfa1479d2
commit 7c83657397
4 changed files with 96 additions and 1 deletions

View File

@ -100,6 +100,20 @@ add_custom_target(
${GENERATED_PACKAGE_TAGS}
)
# Optional targets for nvim.desktop file and icon.
find_program(XDG_MENU_PRG xdg-desktop-menu)
find_program(XDG_ICON_PRG xdg-icon-resource)
if(XDG_MENU_PRG)
add_custom_target(desktop-file
COMMAND xdg-desktop-menu install --novendor ${PROJECT_SOURCE_DIR}/runtime/nvim.desktop)
# add_dependencies(runtime desktop-file)
endif()
if(XDG_ICON_PRG)
add_custom_target(desktop-icon
COMMAND xdg-icon-resource install --novendor --size 128 ${PROJECT_SOURCE_DIR}/runtime/nvim.png)
# add_dependencies(runtime desktop-icon)
endif()
# CMake is painful here. It will create the destination using the user's
# current umask, and we don't want that. And we don't just want to install
# the target directory, as it will mess with existing permissions. So this

81
runtime/nvim.desktop Normal file
View File

@ -0,0 +1,81 @@
[Desktop Entry]
Name=Neovim
GenericName=Text Editor
GenericName[de]=Texteditor
Comment=Edit text files
Comment[af]=Redigeer tekslêers
Comment[am]=
Comment[ar]=حرّر ملفات نصية
Comment[az]=Mətn fayllarını redaktə edin
Comment[be]=Рэдагаваньне тэкставых файлаў
Comment[bg]=Редактиране на текстови файлове
Comment[bn]= ি
Comment[bs]=Izmijeni tekstualne datoteke
Comment[ca]=Edita fitxers de text
Comment[cs]=Úprava textových souborů
Comment[cy]=Golygu ffeiliau testun
Comment[da]=Redigér tekstfiler
Comment[de]=Textdateien bearbeiten
Comment[el]=Επεξεργασία αρχείων κειμένου
Comment[en_CA]=Edit text files
Comment[en_GB]=Edit text files
Comment[es]=Edita archivos de texto
Comment[et]=Redigeeri tekstifaile
Comment[eu]=Editatu testu-fitxategiak
Comment[fa]=ویرایش پروندههای متنی
Comment[fi]=Muokkaa tekstitiedostoja
Comment[fr]=Édite des fichiers texte
Comment[ga]=Eagar comhad Téacs
Comment[gu]=
Comment[he]=ערוך קבצי טקסט
Comment[hi]= ि
Comment[hr]=Uređivanje tekstualne datoteke
Comment[hu]=Szövegfájlok szerkesztése
Comment[id]=Edit file teks
Comment[it]=Modifica file di testo
Comment[ja]=
Comment[kn]= ಿ
Comment[ko]=
Comment[lt]=Redaguoti tekstines bylas
Comment[lv]=Rediģēt teksta failus
Comment[mk]=Уреди текстуални фајлови
Comment[ml]= ി
Comment[mn]=Текст файл боловсруулах
Comment[mr]= ि
Comment[ms]=Edit fail teks
Comment[nb]=Rediger tekstfiler
Comment[ne]=
Comment[nl]=Tekstbestanden bewerken
Comment[nn]=Rediger tekstfiler
Comment[no]=Rediger tekstfiler
Comment[or]= ି
Comment[pa]=
Comment[pl]=Edytor plików tekstowych
Comment[pt]=Editar ficheiros de texto
Comment[pt_BR]=Edite arquivos de texto
Comment[ro]=Editare fişiere text
Comment[ru]=Редактор текстовых файлов
Comment[sk]=Úprava textových súborov
Comment[sl]=Urejanje datotek z besedili
Comment[sq]=Përpuno files teksti
Comment[sr]=Измени текстуалне датотеке
Comment[sr@Latn]=Izmeni tekstualne datoteke
Comment[sv]=Redigera textfiler
Comment[ta]=
Comment[th]=
Comment[tk]=Metin faýllary editle
Comment[tr]=Metin dosyalarını düzenle
Comment[uk]=Редактор текстових файлів
Comment[vi]=Son tho tp tin văn bn
Comment[wa]=Asspougnî des fitchîs tecses
Comment[zh_CN]=
Comment[zh_TW]=
TryExec=nvim
Exec=nvim %F
Terminal=true
Type=Application
Keywords=Text;editor;
Icon=nvim
Categories=Utility;TextEditor;
StartupNotify=false
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;

BIN
runtime/nvim.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -1537,7 +1537,7 @@ static int included_patches[] = {
// 907 NA
// 906 NA
// 905 NA
// 904 NA
904,
903,
// 902 NA
901,