- Interprocess communication (IPC) system for apps.
- Runs as a service.
- Two buses:
- System bus: e.g. to notify about hardware connect/disconnect. Its service:
systemctl status dbus
. - Session bus: Specific to user sessions, e.g. communication between Gnome components. Its service:
systemctl --user status dbus
.
- System bus: e.g. to notify about hardware connect/disconnect. Its service:
dbus-run-session <cmd>
: Starts a new session bus and runcmd
in that session (to have access to the session dbus for IPC):- e.g
gnome-shell --nested
: Start Gnome within an existing session (for dev. & testing) without affecting the primary UI.
- e.g
- GSettings: System for Gnome apps to manage their settings.
- dconf: underlying backend database for GSettings, with parameters stored in key-value format.
- Variant type (like C's
union
and C++'sstd::variant
) that may contain:- Simple types: int, bool.
- Complex types: array of dict.
- Usage: data to be serialized:
- Data sent over D-Bus.
- Saved settings with GSettings.
Create a new extension: gnome-extension create --interactive
- Two mandatory files: metadata.json, and extension.js
- extension.js:
- Runs in the same process as gnome-shell.
- Uses Clutter and St toolkits (latter builds on Clutter to provide more Widgets & CSS), like gnome-shell.
- prefs.json: Preferences for extension.
- Runs in a separate process from Gnome-shell.
- Uses GTK4 and Adwaita.
- Adwaita: Toolkit that offers widgets to build Gnome apps (extends GTK base widgets).
-
Local:
~/.local/share/gnome-shell/extensions
-
System-wide:
/usr/share/gnome-shell/extensions/
-
gi:// is used to load bindings to C libraries (Gtk, St, Clutter...) generated via GObject introspection.
-
resource:///org/gnome/shell/... is used to load a file embedded in Gnome-shell iteself.
- Looking Glass (lg): Inspector tool and js console, run with
Alt-F2 > lg
. - Logs:
$ journalctl -f /usr/bin/gnome-shell
. - Console:
$ gjs-console
-
glib-compile-schemas: compiles an xml file (GSettings schema) into a binary file (that defines app settings).
-
glib-compile-resources: compiles resources listed in an xml file into binary files that can be accessed dynamically at runtime (to avoid issues with file locations and relative paths).