Настройте, какую программу использовать в качестве терминала

888
Dave Vogt

Я создал neovim.desktopфайл для (терминального) приложения, который выглядит следующим образом:

[Desktop Entry] Name=Neovim MimeType=text/english;text/plain;... Exec=nvim -f %F Type=Application Terminal=true 

Как видите, он запрашивает запуск в окне терминала. Это прекрасно работает, но всегда открывается xterm. Теперь вопрос: где в моей системе настроено, какой терминал использовать для таких приложений?

Это зависит от рабочего стола? Если так: Где это в GNOME? Где (так что это полезно и для других людей) это в KDE?

0

2 ответа на вопрос

1
grawity

There is no standard location for this; it depends on the desktop environment.


In GNOME 3, this is stored in dconf/GSettings:

$ gsettings list-recursively org.gnome.desktop.default-applications.terminal org.gnome.desktop.default-applications.terminal exec 'gnome-terminal' org.gnome.desktop.default-applications.terminal exec-arg '-x' $ gsettings set org.gnome.desktop.default-applications.terminal exec xterm 

The same for Cinnamon, except under the org.cinnamon.desktop.⋯ domain.


GNOME 2 used to keep this in GConf:

$ gconftool-2 -R /desktop/gnome/applications/terminal exec = gnome-terminal exec_arg = -x $ gconftool-2 -s /desktop/gnome/applications/terminal/exec -t string xterm 
1
Dave Vogt

After the suggestions from grawity did not work out as expected, I searched a bit further, and found that GLIB has the list of terminal emulators hardcoded. So it does not reflect any settings when an application is launched using it's functionality.

The corresponding source can be found here: https://github.com/frida/glib/blob/master/gio/gdesktopappinfo.c#L2467 - Search for "gnome-terminal" in that file if the line number does not match anymore.

So - if you use one of the terminals in that list, uninstall the ones higher up on that list. If you use another one, create a script named xterm in /usr/local/bin and have it call your terminal. This is what I've done now:

#!/bin/sh exec sakura "$@" 

Похожие вопросы