This is kind of a write-up for myself, because apparently I need to learn the same things again every few years.
Man, for years and years there has always some schism between thunar / xfce and newer terminal emulators and every few years when I do a fresh install I need to go through the same hoops of
- installing something like
alacritty
- See that
thunar
only usesxfce-terminal
- Uninstall
xfce-terminal
- Now
thunar
usesxterm
- some swearing and confused poking around
- mime types?? something somethingā¦
Granted, some of this must be because of using tiling window managers, so maybe some component got left out when using dwm or i3. (Could be something like this settings daemon not running or something)
Lately things got really close to fully working. Even the thunar context menu āopen terminal hereā opens the right terminal. But until of now I still could really use thunar because if I would try to open text files in regular old vim or nvim, the terminal it would spawn would again be something random, I donāt even know what, but it doesnāt have a right click menu and I cannot find shortcuts for zooming and the font size looks like 6pt.
So future me, these are some of the things that have lead to things finally working:
- be sure to set your TERMINAL env variable in your dotfiles
- install
xfce4-mime-settings
and set terminal emulator there - in thunar edit menu, above āpreferencesā go to āconfigure custom actionsā. See that in āOpen terminal hereā settings the command is set to
exo-open --working-directory %f --launch TerminalEmulator
. If it still doesnāt work, you can hardcode your terminal there - To open text files from thunar, copy your editors .desktop file from the system side to user side
cp /usr/share/applications/nvim.desktop ~/.local/share/applications/nvim.desktop
. Now edit the file and change theexec=...
toexec=alacritty -e nvim %F
. - Or better yet, install
neovim-remote
and change the exec toexec=alacritty -e nvr -s %F
so that all the opened files fill open in the same nvim instance to a new buffer.
Thanks