1

I installed a customized css file for the GDM of Ubuntu 18.04 via 2 approaches. Surprisingly, they gave different results:

Approach (A)

  1. I saved my customized GDM css file as /usr/share/gnome-shell/theme/ubuntu.css. That is, I had replaced the original ubuntu.css file with my own .css file, but gave the new file the same name as ubuntu.css.
  2. I pressed Alt+F2 followed by r+ Return to restart the GDM.
  3. Next, I pressed Super+L to lock my desktop. From there, I was first able to see the wallpaper setup by gnome-tweaks for the lockscreen. The widget styles of the lockscreen adhered to my customized css file. Next, for the unlockscreen, its wallpaper and widget styles followed my customized css file.
  4. To see the result of my customized css file on the loginscreen, I had to restart the system or logout from my current session.

Approach (B)

1 I used these commands:

$ sudo update-alternatives --auto gdm3.css
$ sudo update-alternatives --install /usr/share/gnome-shell/theme/gdm3.css gdm3.css /usr/share/gnome-shell/theme/mytheme/mytheme.css 11
update-alternatives: using /usr/share/gnome-shell/theme/mytheme/mytheme.css to provide /usr/share/gnome-shell/theme/gdm3.css (gdm3.css) in auto mode
$ sudo update-alternatives --config gdm3.css
There are 2 choices for the alternative gdm3.css (providing /usr/share/gnome-shell/theme/gdm3.css).

  Selection    Path                                                    Priority   Status
------------------------------------------------------------
* 0            /usr/share/gnome-shell/theme/mytheme/mytheme.css   11        auto mode
  1            /usr/share/gnome-shell/theme/mytheme/mytheme.css   11        manual mode
  2            /usr/share/gnome-shell/theme/ubuntu.css            10        manual mode

Press <enter> to keep the current choice[*], or type selection number: 
  1. I pressed Alt+F2 followed by r+ Return to restart the GDM.
  2. Next, I pressed Super+L to lock my desktop. Unlike Approach A, I was unable to see the wallpaper and styles defined in my customized css file in the unlockscreen; it was a purple screen with the usual ubuntu unlock widgets appeared. For the lockscreen (i.e. screensaver), it showed the wallpaper setup by gnome-tweaks but it's widget style did not follow my customized css file.
  3. To see if the effect of my customised css file would appear in the loginscreen, I restarted the system. I was glad to find the wallpaper and styles defined in my customised ccs appearing in the loginscreen. However, after logging in, and after pressing Super+L to lock my desktop, the issues described in 3. still persisted.

Can you explain to me why Approach B and Approach A yielded different end products? In particular, why did the style and wallpapers defined in my customized css file not appear in the unlockscreen and the widget styles defined in my customized css file not appear in lockscreen for Approach B?

0

1 Answer 1

1

In a fresh Install of Ubuntu 18.04,

If you observe the file /usr/share/gnome-shell/modes/ubuntu.json

{
    "parentMode": "user",
    "stylesheetName": "ubuntu.css",
    "enabledExtensions": ["[email protected]", "[email protected]"]
}

the line stylesheeName: ubuntu.css indicates that the default-shell theme (i.e when no user-theme gnome-shell-extension is installed) uses the theme file /usr/share/gnome-shell/theme/ubuntu.css

and the background you will have in this file, uses for the unlock-screen background

So when you use your "Approach B" you need to edit the line like this: sylesheetName: "mytheme/mytheme.css",

1
  • Thanks, it worked! Wow so many layers to configure the styles of the loginscreen, unlockscreen, lockscreen and the desktop... really appreciate your help.... Is there a formal documentation that describes and explain all these configuration files and procedures? I think it will benefit the user community greatly.
    – Sun Bear
    Oct 8, 2019 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .