Re: [Vala] Get default terminal emulator?



On 06/22/2012 10:33 PM, PCMan wrote:
On Fri, Jun 22, 2012 at 6:46 PM, Thomas Jollans<t jollybox de>  wrote:
Hi list,

How do I get the user's default terminal emulator with GLib/GIO? I would
assume it involves GLib.AppInfo in some way, but it's not as straightforward
as that since there isn't really a MIME type associated with opening a
terminal window as far as I know.

Is there even a freedesktop-standard way of doing this? On GNOME, I imagine
one could go into the depths of GSettings, but can that work for non Gnome
users? On Debian/Ubuntu, running x-terminal-emulator will get you the system
default, but that doesn't exist on other systems and disregards the user's
preferences.

Unfortunately, no. They hard-coded a list of well-known terminal
emulators, and try them one by one.
This is what GAppInfo does in glib/gio. The worst thing is, there is
no config option for this.
The config value in gconf/gsettings does not change the behavior of GAppInfo.
The glib/gio devs know this, but they just did not fix it.


What a mess. I assume you're talking about the run command in terminal functionality of GIO (which I assume exists)? Just FYI, what I'm doing here is simply launching the terminal emulator in a certain directory, in the Emperor file manager. I'm going for reading out the GSettings value for org.gnome.desktop.default-applications.terminal/exec, and if that doesn't work, falling back to xterm. Should be good enough most of the time.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]