You are not logged in.

#1 2024-03-27 04:06:09

A-Fellow-Human
Member
Registered: 2022-10-15
Posts: 35

[SOLVED] Change default console when opening .desktop shortcuts on KDE

I'm currently using KDE Plasma 6. I used to use alacritty as the default terminal emulator, including to open .desktop shortcuts (I don't remember what I did).
I'd like to switch back to Konsole, but I've forgotten what I've done. As a result, things like btop now use alacritty, instead of konsole.
I tried changing the default application back to Konsole in Plasma settings, to no avail. I also tried deleting alacritty but now apps don't run at all.
I tried "xdg-open ~/.bashrc" to see what would happen and I got

kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
kf.kio.core: Terminal "alacritty" not found, service "Neovim"
kf.kio.gui: "Terminal alacritty not found while trying to run ~/.local/share/applications/nvim.desktop"

"echo $TERM" returns "xterm-256color" and "echo $TERMINAL" returns "konsole".
Any ideas?

Last edited by A-Fellow-Human (2024-04-01 05:56:23)

Offline

#2 2024-03-27 07:46:48

Nebulosa
Member
Registered: 2009-08-24
Posts: 48

Re: [SOLVED] Change default console when opening .desktop shortcuts on KDE

Offline

#3 2024-03-27 14:31:52

A-Fellow-Human
Member
Registered: 2022-10-15
Posts: 35

Re: [SOLVED] Change default console when opening .desktop shortcuts on KDE

Try what specifically?

I already had a look at the page before posting but I don't know which MIME type corresponds to the default terminal. I tried "xdg-mime query default application/x-shellscript" but that just points to nvim.

Last edited by A-Fellow-Human (2024-03-27 14:32:56)

Offline

#4 2024-03-27 14:56:21

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,155

Re: [SOLVED] Change default console when opening .desktop shortcuts on KDE

There's a setting for this in KDE's system settings, have you checked that?

Online

#5 2024-03-27 19:06:18

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: [SOLVED] Change default console when opening .desktop shortcuts on KDE

Not sure if it works for Qt desktops but for xdg-open the OP could create a wrapper script at /usr/local/bin/xdg-terminal-exec to launch alacritty, as per the last answer here.

EDIT: and the error message in the OP is because xdg-open is trying to run ~/.local/share/applications/nvim.desktop, which is presumably hard-coded for alacritty. Check for other .desktop files in that directory.

Last edited by Head_on_a_Stick (2024-03-27 19:25:48)

Offline

#6 2024-03-27 21:17:34

seth
Member
Registered: 2012-09-03
Posts: 53,584

Re: [SOLVED] Change default console when opening .desktop shortcuts on KDE

for xdg-open the OP could create a wrapper script at /usr/local/bin/xdg-terminal-exec

Which itself is probably on the chopping block already:
https://gitlab.gnome.org/GNOME/glib/-/issues/338

(there're a couple of threads on this forum itr because for a while it was completely impossible to select the default TE on gnome)

In reality, there's no spec - one could have just interpreted $TERMINAL but that's oc way too simple and it's better to have https://imgs.xkcd.com/comics/standards.png
The OP is using KDE so the only reliable approach is V1del's comment.

Offline

#7 2024-04-01 05:51:58

A-Fellow-Human
Member
Registered: 2022-10-15
Posts: 35

Re: [SOLVED] Change default console when opening .desktop shortcuts on KDE

So I went back to the "Default Applications" settings, switched the terminal emulator to foot, and tried opening btop. That worked.

I then switched back to konsole, and terminal applications use the correct terminal emulator instead of using alaccritty.

Weird bug, but whatever. Thanks seth for convincing me to have a look at the settings page again, because I would've tried to keep doing weird things to get terminal apps working.

Offline

Board footer

Powered by FluxBB