Doesn't seem to be possible without workaround.
https://askubuntu.com/a/294430
Gtk-launch (a part of gtk) is not related to x-terminal-emulator
at all. In my case glib2 2.68.0 (behind gtk-launch) has its terminal choosing logic hardcoded in prepend_terminal_to_vector() in gio/gdesktopappinfo.c.
# Most preferred
gnome-terminal -- APP ARG1 ARG2 ...
# Then
mate-terminal -x APP ARG1 ARG2 ...
xfce4-terminal -x APP ARG1 ARG2 ...
# After that
tilix -e APP ARG1 ARG2 ...
konsole -e APP ARG1 ARG2 ...
nxterm -e APP ARG1 ARG2 ...
color-xterm -e APP ARG1 ARG2 ...
rxvt -e APP ARG1 ARG2 ...
dtterm -e APP ARG1 ARG2 ...
# Last resort
xterm -e APP ARG1 ARG2 ...
A dirty workaround on my machine
I want to invoke alacritty -e ...
1. Create a dummy gnome-terminal (α)
sudo install -vDm755 /dev/null /usr/local/bin/gnome-terminal
2a. If you do NOT have gnome-terminal
installed, put the following into α
#!/bin/bash
[ x"$1" = x"--" ] || { exec /usr/bin/gnome-terminal "$@"; exit 0; }
shift
TITLE="$(basename "$1")"
if [ -n "$TITLE" ]; then
/usr/bin/alacritty -t "$TITLE" -e "$@"
else
/usr/bin/alacritty -e "$@"
fi
2b. If you have gnome-terminal
installed, put the following into α
#!/bin/bash
[ x"$1" = x"--" ] || exit 1
shift
TITLE="$(basename "$1")"
if [ -n "$TITLE" ]; then
/usr/bin/alacritty -t "$TITLE" -e "$@"
else
/usr/bin/alacritty -e "$@"
fi
askubuntu x-post