Cant get thunar to open neovim with alacritty

Im using endeavouros galileo with the i3 wm, i wanted to switch from xfce4-terminal to alacritty and i have some problems with it and thunar. At first i could not even use the custom action “Open Terminal Here” but i solved it by making the file helpers.rc in xfce4 config folder and with “TerminalEmulator=alacritty
TerminalEmulatorDismissed=true”
in it, and now it works. The problem i am having is that i cant open files with neovim directly from thunar and it gives me the error “Failed to open file “[file name]”. Unable to find terminal required by application.”
Im using nvchad installed from aur if that matters,
Is there a way to fix this or is it easier to just change the file manager?
Sorry if this question has allready bean asked and i didnt see it and thanks in advance.

What if you capitalize the “a” in “alacritty”?

Edit:
Also, what happens when you run:

$ exo-open --launch=TerminalEmulator nvim

I have a hunch that you will get an error if you run this command because: a) the .desktop file needs to have X-XFCE-Commands entry before you can use the helper; b) you need to pass a -e flag to alacritty in order to execute another command in it.

Try the following.

First, create the custom .desktop file ~/.local/share/xfce4/helpers/AlacrittyThunar.desktop with the following contents:

[Desktop Entry]
NoDisplay=true
Version=1.0
Encoding=UTF-8
Type=X-XFCE-Helper
X-XFCE-Category=TerminalEmulator
X-XFCE-CommandsWithParameter=alacritty -e "%s"
X-XFCE-Commands=alacritty
Icon=alacritty
Name=alacritty

After that, go to your helpers.rc and change the entry:

TerminalEmulator=alacritty

to

TerminalEmulator=AlacrittyThunar

Running exo-open --launch=TerminalEmulator nvim should work after this step. If it works, you should be able to open any file with Neovim via Thunar.

I did exactly as you said but it still not works and now i cant even use “Open Terminal Here”, i cant even execute the .desktop.
I have the errors here if it helps https://imgur.com/a/lLyo5Qd

Try this instead.

Create the desktop file ~/.local/share/applications/nvim.desktop with the following contents:

[Desktop Entry]
Name=Neovim
Exec=alacritty -e nvim %F
Terminal=false
Type=Application
Keywords=Text;editor;
Icon=nvim
Categories=Utility;TextEditor;
StartupNotify=false

After that, open up Thunar and use the “Open with Neovim” context menu on a text file. This should work because I tested it on my own system.

Yep it worked, thank you so much.

You’re welcome.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.