Previous Post | Top | Next Post |
TOC
This is how I resolved GNOME shell configuration trouble and came up as Debian Workstation (usability) (v2023) – Keyboard shortcut customization (GNOME Settings – custom shortcut)
Keyboad shortcuts stopped working
Since 2022, tricks written in my old キーボード入力モード選択 and its English translated description Debian Workstation (usability) (old)) – Keyboard shortcut customization (GNOME Settings) stopped working for me.
This breakage seemed to have happened with changes made in 2022.
My initial reaction to brokage of trick method was this may be caused by changes of javascript codes in gnome-shell.
GNOME post-40 releases have major changes from previous ones.
package | bullseye (2021) | bookworm (2023) |
---|---|---|
gnome-shell |
3.38.6-1~deb11u1 |
43.4-1 |
Where in gnome-shell package can I find its javascript codes?
Older documentation such as
“GNOME shell: Javascript Source Documentation (extensions development)”
written in 2012 talks about javascript codes in /usr/share/gnome-shell/js/ui
.
But I don’t see them on my system.
Then I found “Where are gnome-shell’s UI javascript files on Ubuntu 20.04” written in 2020.
Now the whole javascript codes are packed into
/usr/lib/gnome-shell/libgnome-shell.so
. The javascript codes can be found in
the original source tree or retrieved from installed
/usr/lib/gnome-shell/libgnome-shell.so
using gresource
command.
Are there any changes in related javascript codes in gnome-shell.
Let’s check the original source tree under js
$ cd path/to/gnome-shell-43.4/js/ui
$ rg getInputSourceManager
status/keyboard.js
793:function getInputSourceManager() {
864: this._inputSourceManager = getInputSourceManager();
keyboard.js
202: let inputSourceManager = InputSourceManager.getInputSourceManager();
2172: this._inputSourceManager = InputSourceManager.getInputSourceManager();
2240: const inputSourceManager = InputSourceManager.getInputSourceManager();
Checking code around these lines for both versions used in bookworm (2023) and buster (2021), I don’t see much changes.
Getting start with “Looking Glass”
Looking Glass is GNOME Shell’s integrated debugger and inspector tool. It’s basic usage goes:
- Open with
Alt-F2
- Enter
lg
to “Run a Command” prompt to start “Looking Glass” - Enter a command e.g.
global.get_window_actors()
to the “Looking Glass” prompt - Enter
Esc
to leave “Looking Glass”
Tricks for the “Looking Glass” prompt
St.set_slow_down_facor(10)
– slow downSt.get_slow_down_facor()
– check ???? not working
Testing under “Looking Glass”
I tested the following javascript snippet and its variants from “Looking Glass” prompt.
imports.ui.status.keyboard.getInputSourceManager().inputSources[0].activate()
This switched Input method to the first one. Using inputSources[1]
instead swiched Input method to the second one. So this javascript code itself is still valid one.
So, problem is not javascript but its call via gdbus
executed on the bash prompt.
$ gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources[0].activate()"
(false, '')
This false looks suspicious.
Let me check if this calling was syntax correct by introspection:
$ gdbus introspect --session --dest org.gnome.Shell --object-path /org/gnome/Shell
node /org/gnome/Shell {
...
interface org.gnome.Shell {
methods:
Eval(in s script,
out b success,
out s result);
...
};
...
};
So the calling syntax looks OK.
Root cause: gdbus
error
Searching on “gdbus error” within 1 year lead me to the following articles.
- dbus calls to gnome shell don’t work under Ubuntu 22.04 – 2022
- commit: shellDBus: Restrict callers – 2022
- Unsafe Mode Menu – Simple GNOME extension to change the Gnome Shell unsafe-mode via the quick settings menu/panel menu.
It looks like now shellDBus restricts callers to block gdbus
calls.
Workaround: Unsafe Mode Menu
I decided to install Unsafe Mode Menu and it worked!
This workaround was good enough to update Debian Workstation (usability) (v2023) – Keyboard shortcut customization (GNOME Settings – custom shortcut).
Note on code tracing
String match to find associated code points
I tried to find interesting code points from associated menu strings by running rg
or rg -i
command over source code trees.
- “
Launchers
” is in thegnome-shell
source tree as “name="Launchers
” in “data/50-gnome-shell-launchers.xml
” - But I can’t find"
Custom Shortcuts
" with case matched ingnome-shell
nor ingnome-settings-daemon
- Exact “
Custom Shortcuts
” isn’t ingnome-shell
norgnome-settings-daemon
source trees. - Case-insensitive “
Custom Shortcuts
” is in thegnome-settings-daemon
source tree as comment “/* Custom shortcuts */
”.- This leads to look for “
custom-keybindings
” and found it indata/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in
.
- This leads to look for “
- Exact “
Custom Shortcuts
” is in thegnome-control-center
source tree as C code.
So I need to search multiple packages to understand how GNOME desktop works and
not all UI frontend codes such as ones in gnome-control-center
are written in javascript.
I suppose I need to revisit this problem after learning GNOME.
What is a11y
Although many file names and directory names in the GNOME source code use intuitive names, a11y
was a bit intriguing. a11y stands for ACCESSIBILITY.
Previous Post | Top | Next Post |