Skip to content

Instantly share code, notes, and snippets.

@Darkle
Last active July 29, 2022 12:49
Show Gist options
  • Save Darkle/01b944bece0bf3d3f8d874f355cfe5bf to your computer and use it in GitHub Desktop.
Save Darkle/01b944bece0bf3d3f8d874f355cfe5bf to your computer and use it in GitHub Desktop.
neovim .desktop with icon
  • This .desktop example will launch neovim in gnome-terminal but with a custom icon instead of the default gnome-terminal icon
  • I am using --tab-with-profile="NeoVim" to start in a different profile in gnome-terminal. You can omit that and it will still work.
  • Thanks to this post: https://unix.stackexchange.com/a/387651/535616
  • You can change the window opening size by changing the gnome-terminal profile settings
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Version=1.0
Name=NeoVim
Comment=Text Editor and IDE
Exec=gnome-terminal --hide-menubar --title="NeoVim" --tab-with-profile="NeoVim" -- /path-to/nvim %F
Icon=/path-to/Icons/vim.png
Terminal=false
Categories=GTK;Development;IDE;TextEditor;
MimeType=text/plain;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-dsrc;text/x-pascal;text/x-perl;text/x-python;application/x-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/xml;text/html;text/css;text/x-sql;text/x-diff;
StartupNotify=true
# This StartupWMClass is important for the icon to show and not the regular terminal icon
StartupWMClass=gnome-terminal-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment