You are not logged in.

#1 2025-02-28 04:10:40

JianYang
Member
Registered: 2025-02-28
Posts: 1

Change terminal that is used to open .desktop files with terminal=true

I've recently switched from KDE to Hyprland, and KDE had Konsole installed as its default terminal. I removed Konsole after removing KDE and hopefully the rest of KDE plasma related files and now I'm using kitty as my main terminal.

The issue lies in the fact that my system is still somehow seeing Konsole as the default terminal (I know arch doesn't have a default terminal by default and neither does Hyprland, but something is obviously redirecting my system to Konsole).

Correct me if I'm wrong but while researching this issue I realized this is related to xdg-utils package. The problem is I can't figure out how to change the default terminal xdg uses or rather redirects apps to.

I know that there's a workaround that consists of editing the .desktop files, setting the terminal=false and then appending the terminal of my choice to the exec option. That does work, but as I said, it's a workaround and I'd have to edit .desktop files every time I install an app that is run through the terminal, which is annoying.

TL;DR: Switched from KDE to hyprland. Apps with terminal=true in their .desktop files open through the wrong and since deleted terminal. Can't figure out how to tell my system to open those apps in newly installed terminal.

I've been battling with this issue for days and I can't seem to find a straightforward answer to this question anywhere so this post is me giving up and asking you for help. Thank you in advance.

Currently running Arch with Hyprland. Don't have any .desktop launchers except for xdg-open(xdg-utils). This issue arises every time I try to open the nvim.desktop app(In dolphin, through wofi, or through gtk-launch which I installed to see if it'd make a difference)

Offline

#2 2025-02-28 10:44:05

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,961

Re: Change terminal that is used to open .desktop files with terminal=true

It appears that is tricky, but setting the env TERMINAL to your preferred terminal application gives the best chance to work .

A few links with more info :

https://bbs.archlinux.org/viewtopic.php?id=274444
https://unix.stackexchange.com/question … al-program


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 2025-02-28 16:11:47

RatzingerZeta
Member
From: BCN
Registered: 2025-02-13
Posts: 6

Re: Change terminal that is used to open .desktop files with terminal=true

The unique workaround that solves the Neovim/alacritty (in my case) is the *.desktop thing. I put the fancy TERMINAL=/usr/bin/alacritty in my rc, but did not work.

Offline

#4 2025-03-18 12:04:47

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 713

Re: Change terminal that is used to open .desktop files with terminal=true

I use GNOME and for some odd reason it has started running ghostty instead of gnome-terminal for desktop apps that specify Terminal=true. I first installed ghostty ages ago so no idea why it has just started doing this. Anyhow, I found that glib added support for a script "xdg-terminal-exec" some time ago but it does not seem to be supported by Arch. So I just created a script `/usr/bin/xdg-terminal-exec`:

#!/bin/sh
exec /usr/bin/gnome-terminal -- "$@"

and that fixes the problem.

Offline

#5 2025-03-18 12:24:04

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,961

Re: Change terminal that is used to open .desktop files with terminal=true

That may be because xdg-terminal-exec appears to be a proposal for now.

The link won't work until approx 2025-03-22 due to the freedesktop.org migration from equinix to hetzner.

You can try the aur pacakge xdg-terminal-exec .


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

#6 2025-03-18 12:44:08

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 713

Re: Change terminal that is used to open .desktop files with terminal=true

I actually did first try both xdg-terminal-exec and the xdg-terminal-exec-git packages from the AUR but both currently fail with a 503 error. But then I realised utlitmately a trivial script like I implemented is all that is needed.

PS: Also, I know it is supposed to be only a proposal but glib does actually currently implement support for that script already.

Last edited by bulletmark (2025-03-18 12:47:06)

Offline

#7 2025-04-30 00:05:53

anikio
Member
Registered: 2025-04-29
Posts: 1

Re: Change terminal that is used to open .desktop files with terminal=true

I had this problem while trying to open vim on kitty with wofi, I managed to fix it by editing "~.config/hyprland-xdg-terminals.list" and "~.config/xdg-terminals.list" and adding the line "kitty.desktop" and then installing the aur package xdg-terminal-exec

I hope that works for you

PD: If you don't see the file try installing xdg-desktop-portal-hyprland or creating the file manually

Last edited by anikio (2025-05-02 23:52:31)


I'm still trying to configure hyprland

Offline

#8 2025-04-30 03:39:02

mountaintrek
Member
Registered: 2024-02-01
Posts: 60

Re: Change terminal that is used to open .desktop files with terminal=true

Maybe...

In Hyprland with the default config

Use SUPER + Q to launch kitty. If you wish to choose the default terminal before you proceed, you can do so in ~/.config/hypr/hyprland.conf (example config).

Offline

#9 2025-09-06 22:04:36

zaelum
Member
Registered: 2025-09-06
Posts: 1

Re: Change terminal that is used to open .desktop files with terminal=true

I encountered a similar issue with neovim in Fedora but figured I would post my solution. I wanted to go back to Konsole but it was stuck with kitty. I found under ~/.config there is a kdeglobals file. You can change the below to your desired terminal and log out and back in for it use the correct terminal.

TerminalApplication=konsole
TerminalService=konsole.desktop

Offline

Board footer

Powered by FluxBB