You are not logged in.

#1 2023-07-11 10:25:28

lavrent
Member
Registered: 2023-07-11
Posts: 3

Change default Terminal emulator to open .desktop files

Hello,

My preferred text editor and terminal are Neovim and Kitty, respectively. My WM is Hyprland. When executing `xdg-open <insert text file>`, it opens nvim in the same terminal window.
However, when running this command in a run prompt, e. g. rofi, nothing happens. Additionally, when I try to open /usr/share/applications/nvim.desktop from a graphical file manager, e. g. Thunar, there is the error message:

"Failed to launch preferred application for category "TerminalEmulator".

FYI, the nvim.desktop file contains the following information:

Terminal=true
Exec=nvim %F

My question is how to configure the default terminal application so that other applications like the lf terminal file manager can run nvim.desktop and open those files in the same window.

Because if I change nvim.desktop to Exec=kitty nvim %F, it will always launch in a new window and this is not what I want.

I thank all in advance. Any help is appreciated.

Last edited by lavrent (2023-07-11 10:36:10)


--verbose makes creating zip files more exciting than it should be.

Offline

#2 2023-07-11 11:32:22

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,205

Re: Change default Terminal emulator to open .desktop files

Thunar is the xfce4 filemanager and appears to need xfce4 specific settings.

https://superuser.com/questions/1614042 … alemulator indicates those settings come from a file called helpers.rc which is included in xfce4-settings .

No idea about the other questions but keep in mind both rofi and thunar are intended to run under X, not wayland.

Welcome to archlinux forums


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-07-13 17:23:12

lavrent
Member
Registered: 2023-07-11
Posts: 3

Re: Change default Terminal emulator to open .desktop files

Thank you for the reply!

It seems that you're right, regarding Thunar. However, doing this trick with rofi doesn't work on X either. As far as I understand, xdg-open <cli application> works if the command is being put into a terminal, because then it gets opened there. But with rofi, there is none so it doesn't know what do to.

What I was looking for was a way to tell XDG what the go-to terminal should be.


--verbose makes creating zip files more exciting than it should be.

Offline

#4 2023-07-14 07:14:15

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,205

Re: Change default Terminal emulator to open .desktop files

As far as I understand, xdg-open <cli application> works if the command is being put into a terminal, because then it gets opened there.

That is the way the Terminal Emulator handles executing the command and typically is the same for any command executed in that TE.

You'll have to configure rofi to act similar, not xdg-open.
https://wiki.archlinux.org/title/Rofi#E … _from_rofi may help to craft  a runner for rofi that works that way.

Last edited by Lone_Wolf (2023-07-14 07:14:38)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2023-07-15 17:07:31

lavrent
Member
Registered: 2023-07-11
Posts: 3

Re: Change default Terminal emulator to open .desktop files

Thanks for the page, I'll check it out!

Besides that, I intended to use the trick with lf and I found a workaround yesterday. So I call it a day.


In case any lf users stumble upon this
You have to modify the command "open" at

~/.config/lf/lfrc

Last edited by lavrent (2023-07-15 17:14:04)


--verbose makes creating zip files more exciting than it should be.

Offline

Board footer

Powered by FluxBB