How to Change Default Terminal for Executing .desktop Files

bashcommand linedesktopvim

I've been trying to execute vim with alacritty as default. I have alacritty set as my default terminal emulator already, and in my vim.desktop I changed exec=vim %F with exec=alacritty -e vim %F. The problem is that when I open a file it first executes the command in gnome terminal and then launches vim in alacritty, the thing is that the gnome terminal stays open. I have also tried creating an script:

#!/bin/bash
alacritty -e vim & disown | exit

this does not work at all. I don't know what else to do and I cant find anything online. Thanks in advance!

Is it possible to change the default terminal that runs the Exec= command? so that just by writing Exec=vim %F would run it in alacritty

Best Answer

muru helped me clarify what was going on, thank you! The problem was that my .desktop file:

[Desktop Entry]
Name=Vim
GenericName=Text Editor
Comment=Edit text files
Comment[es]=Edita archivos de texto
TryExec=vim
Exec=alacritty -e vim %F
Terminal=true
Type=Application
Keywords=Text;editor;
Icon=gvim
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++;

Had the argument Terminal=true. What this does is that it executes the Exec= command in a terminal, opening a terminal to do so. If you set Terminal=false this will prevent any terminal from opening and it will just execute the command without opening the terminal.