Ubuntu – How does gnome shell know which config file to use from /usr/share/gnome-shell/modes/

gnome-shell

The directory /usr/share/gnome-shell/modes/ contains the following configuration files that specify which style sheet to use, from the specified gresource, for the Gnome Shell Top Bar, Dash, and Lock Screen.

initial-setup.json
ubuntu.json
yaru.json

How does gnome shell know which of these config files to use/load?

There must be a place where the names initial-setup, ubuntu, or yaru are configured?

Best Answer

It is from the Ubuntu session which is the default at login screen.

enter image description here

session Name Ubuntu -> is the one /usr/share/xsessions/ubuntu.desktop

and its contents are

[Desktop Entry]
Name=Ubuntu
Comment=This session logs you into Ubuntu
Exec=env GNOME_SHELL_SESSION_MODE=ubuntu /usr/bin/gnome-session --systemd --session=ubuntu
TryExec=/usr/bin/gnome-shell
Type=Application
DesktopNames=ubuntu:GNOME
X-GDM-SessionRegisters=true
X-Ubuntu-Gettext-Domain=gnome-session-3.0

Observe the line Exec= in which it is setting the environment variable

GNOME_SHELL_SESSION_MODE=ubuntu