6

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?

6

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
| improve this answer | |
  • Am I correct in assuming this file controls X-Org sessions, while /usr/share/wayland-sessions/ubuntu-wayland.desktop does the same for Wayland sessions? – PJ Singh May 30 at 23:07
  • This works really well. I was able to add a "Ubuntu Custom" option on the login screen by creating /usr/share/xsessions/ubuntu-custom.desktop file.This file points to a customized gnome-shell-theme.gresource (through /usr/share/gnome-shell/modes/), so I do not need to replace the original .gresource file and worry about system updates reverting it. I also tested creating an option for Wayland by creating a /usr/share/wayland-sessions/ubuntu-custom-wayland.desktop file and it works as well. – PJ Singh May 31 at 1:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.