You are not logged in.

#1 2020-07-12 17:39:30

cosmogroid
Member
Registered: 2020-05-31
Posts: 10

Changing terminal in .desktop files

Does anyone know how to go about changing the terminal that lauches when you open a .desktop launcher with the

Terminal=true

option? Currently I'm trying to run htop in my preferred terminal, and I thought that this behavior would be controlled by mimetypes or the specific program used to launch the .desktop file, but neither of those seem to be it. I've tried nemo and pcmanfm and no matter what I do only xterm is ever used, and uninstalling xterm just breaks launching the .deskop launcher. I've tried changing

org.gnome.desktop.default-applications.terminal

with gsettings but that doesn't work either.

Offline

#2 2020-07-12 22:20:53

nemya9066
Member
Registered: 2020-06-13
Posts: 9

Re: Changing terminal in .desktop files

try setting a global TERMINAL variable in your bash profile or zsh profile
in my case to use alacritty as the default I added this line to my .zprofile
export TERMINAL="alacritty"
let me know if this works for you.

Offline

#3 2020-07-13 02:18:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: Changing terminal in .desktop files

nemya9066, that is not a "global" variable, it is an environment variable and therefore has to be set in an environment that is inherited by the program launching the desktop files.  If one using a DM, then this would not inherit from shell profiles.

Theoretically this terminal should be the one configured for or specified by xdg-open.  But in practice I've seen lots of bug reports about this over the years and it seems that different desktop file handling tools may all handle Terminal=true a bit differently.  Setting TERMINAL does seem to be the most often successful step, but only if it is set in an environment that is inherited by the process launching the desktop file.

Last edited by Trilby (2020-07-13 02:24:31)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2020-07-14 21:58:54

cosmogroid
Member
Registered: 2020-05-31
Posts: 10

Re: Changing terminal in .desktop files

Okay, so it seems that the default terminal in this case is specified somehow by the desktop environment, but I'm using openbox. It seems that without a DE, I can uninstall xterm and symlink my terminal to /usr/bin/xterm and that produces the same effect that changing terminals through the GUI in the DEs that I've tested. The "update-alternatives" script that is found in Debian also seems to do something similar by symlinking to the "x-terminal-emulator" file and then somehow directing file managers and the like to that file. In my case though the symlinking trick seems to work fine. I don't even think there is a way to set the xdg terminal emulator in my case, but if anyone knows how to do that please tell me.

Offline

#5 2020-07-14 23:33:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: Changing terminal in .desktop files

openbox doesn't launch desktop files.  In <action> elements for menus and keybindings, you need to put an actual binary executable name.  What are you using to actually launch the desktop files?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB