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?

Enterprise
  • 12,352

1 Answers1

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
PRATAP
  • 22,460
  • 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? – Enterprise May 30 '20 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. – Enterprise May 31 '20 at 01:35