2023-10-23 16:05:05 +02:00
|
|
|
Index: gnome-shell-45.0/js/ui/status/keyboard.js
|
|
|
|
===================================================================
|
|
|
|
--- gnome-shell-45.0.orig/js/ui/status/keyboard.js
|
|
|
|
+++ gnome-shell-45.0/js/ui/status/keyboard.js
|
|
|
|
@@ -274,6 +274,39 @@ class InputSourceSessionSettings extends
|
|
|
|
this._settings.connect(`changed::${this._KEY_INPUT_SOURCES}`, this._emitInputSourcesChanged.bind(this));
|
|
|
|
this._settings.connect(`changed::${this._KEY_KEYBOARD_OPTIONS}`, this._emitKeyboardOptionsChanged.bind(this));
|
|
|
|
this._settings.connect(`changed::${this._KEY_PER_WINDOW}`, this._emitPerWindowChanged.bind(this));
|
2021-01-14 19:27:50 +01:00
|
|
|
+
|
|
|
|
+ let sources = this._settings.get_value(this._KEY_INPUT_SOURCES);
|
|
|
|
+ let nSources = sources.n_children();
|
|
|
|
+ let sourcesList = [];
|
|
|
|
+
|
|
|
|
+ if (nSources <= 1) {
|
|
|
|
+ if (GLib.getenv('LANG') == 'zh_CN.UTF-8') {
|
|
|
|
+ log('Set default input method in Chinese language env.');
|
|
|
|
+ sourcesList.push(['xkb', 'cn']);
|
|
|
|
+ sourcesList.push([ "ibus", "libpinyin" ]);
|
2021-04-12 14:23:54 +02:00
|
|
|
+
|
|
|
|
+ let params = GLib.Variant.new('a(ss)', sourcesList);
|
|
|
|
+ this._settings.set_value(this._KEY_INPUT_SOURCES, params);
|
2021-01-14 19:27:50 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ else if (GLib.getenv('LANG') == 'ja_JP.UTF-8') {
|
|
|
|
+ log('Set default input method in Japanese language env.');
|
|
|
|
+ sourcesList.push([ "ibus", "mozc-jp" ]);
|
2021-03-18 19:31:50 +01:00
|
|
|
+ sourcesList.push(['xkb', 'jp']);
|
2021-04-12 14:23:54 +02:00
|
|
|
+
|
|
|
|
+ let params = GLib.Variant.new('a(ss)', sourcesList);
|
|
|
|
+ this._settings.set_value(this._KEY_INPUT_SOURCES, params);
|
2021-01-14 19:27:50 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ else if (GLib.getenv('LANG') == 'ko_KR.UTF-8') {
|
|
|
|
+ log('Set default input method in Korean language env.');
|
|
|
|
+ sourcesList.push(['xkb', 'kr']);
|
|
|
|
+ sourcesList.push([ "ibus", "hangul" ]);
|
|
|
|
+
|
2021-04-12 14:23:54 +02:00
|
|
|
+ let params = GLib.Variant.new('a(ss)', sourcesList);
|
|
|
|
+ this._settings.set_value(this._KEY_INPUT_SOURCES, params);
|
|
|
|
+ }
|
2021-01-14 19:27:50 +01:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
_getSourcesList(key) {
|