[gnome-shell] ibusManager: Pass on envrionment variables to ibus-daemon
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] ibusManager: Pass on envrionment variables to ibus-daemon
- Date: Sat, 2 Jul 2022 16:15:04 +0000 (UTC)
commit be524776108da5a2762ccea1a47c1bf49493feea
Author: oreo639 <oreo6391 gmail com>
Date: Sun Jun 26 17:56:48 2022 -0700
ibusManager: Pass on envrionment variables to ibus-daemon
Previously only DISPLAY was being passed on to ibus, which results in issues
with missing the WAYLAND_DISPLAY or the DBUS_SESSION_BUS_ADDRESS environemnt
variables for example.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2345>
js/misc/ibusManager.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/js/misc/ibusManager.js b/js/misc/ibusManager.js
index c1e73d0083..420459b769 100644
--- a/js/misc/ibusManager.js
+++ b/js/misc/ibusManager.js
@@ -90,11 +90,25 @@ var IBusManager = class {
this._spawn(Meta.is_wayland_compositor() ? [] : ['--xim']);
}
+ _tryAppendEnv(env, varname) {
+ const value = GLib.getenv(varname);
+ if (value)
+ env.push(`${varname}=${value}`);
+ }
+
_spawn(extraArgs = []) {
try {
let cmdLine = ['ibus-daemon', '--panel', 'disable', ...extraArgs];
let env = [];
+ this._tryAppendEnv(env, 'DBUS_SESSION_BUS_ADDRESS');
+ this._tryAppendEnv(env, 'WAYLAND_DISPLAY');
+ this._tryAppendEnv(env, 'HOME');
+ this._tryAppendEnv(env, 'LANG');
+ this._tryAppendEnv(env, 'LC_CTYPE');
+ this._tryAppendEnv(env, 'COMPOSE_FILE');
+ this._tryAppendEnv(env, 'DISPLAY');
+
GLib.spawn_async(
null, cmdLine, env,
GLib.SpawnFlags.SEARCH_PATH,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]