如何在Ubuntu 20.04中自定義鎖屏主題


2

我按照this answer中的說明將登錄屏幕的gnome shell主題更改為Yaru-dark。當我重啟後登錄時,我確實注意到了黑暗的日曆和系統菜單。但是,當我用Super + L鎖定計算機時,鎖定屏幕仍然具有白色日曆和系統菜單,因此我也希望將其設置為深色。

到目前為止,我看到的所有答案都是針對Ubuntu 18.04的,因為它們指的是/usr/share/gnome-shell/ubuntu.css,而我沒有。我有一個/usr/share/gnome-shell/gnome-shell-theme.gresource,但是將其更改為我的黑暗主題gresource仍然會在鎖定屏幕上產生淺色外殼。其他一些答案是關於/usr/share/gnome-shell/theme/gdm3.css的,我也沒有(我在該目錄中看到的唯一的css文件是gnome-classic.css)。

我只想知道在Ubuntu 20.04上哪個css文件或哪個gresource文件控制鎖定屏幕主題。

A screenshot of my white system menu from the lock screen

1

In a fresh install of Ubuntu 20.04, the default shell theme.. and lock screen both are configured to use the css file

Yaru/gnome-shell.css which is inside the /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource

this is configured in the file /usr/share/gnome-shell/modes/ubuntu.json

{
    "parentMode": "user",
    "stylesheetName": "Yaru/gnome-shell.css",
    "themeResourceName": "theme/Yaru/gnome-shell-theme.gresource",
    "debugFlags": ["backtrace-crashes-all"],
    "enabledExtensions": ["[email protected]", "[email protected]", "[email protected]"]
}

So, you can pointout what ever .gresource file you want to use and the corresponding gnome-shell.css

for example, If I want Yaru-dark theme, I can simply point out like this by editing the file /usr/share/gnome-shell/modes/ubuntu.json

Take Backup of the file /usr/share/gnome-shell/modes/ubuntu.json before editing

{
    "parentMode": "user",
    "stylesheetName": "Yaru-dark/gnome-shell.css",
    "themeResourceName": "theme/Yaru/gnome-shell-theme.gresource",
    "debugFlags": ["backtrace-crashes-all"],
    "enabledExtensions": ["[email protected]", "[email protected]", "[email protected]"]
}

enter image description here

Please note that Default shell theme and lock screen uses same file.. so If you want Yaru shell theme for the desktop session.. you need to install it as a local theme which is another topic.

I have not tried with full path of the .gresource file.. in the line

"themeResourceName": "theme/Yaru/gnome-shell-theme.gresource",

this means.. theme/Yaru/gnome-shell-theme.gresource is a relative path of the base /usr/share/gnome-shell


0

How to Change Lock Screen Background Wallpaper in Ubuntu 20.04 Leave a comment, please.

1.) Open terminal by pressing Ctrl+Alt+T on keyboard. When it opens, run command to make sure gir1.2-clutter-1.0 library is installed:

sudo apt install gir1.2-clutter-1.0

2.) Then in web browser go to extensions.gnome.org/extension/1476/unlock-dialog-background/.

Click on the toggle and confirm on the next pop-up to install the extension.

Don’t see the toggle? Do following steps, then refresh the web page.

Click the link text “click here to install browser extension” and follow the pop-ups to install the browser extension: shell browser extension Then open terminal and run command:

sudo apt install chrome-gnome-shell

3.) Launch either Extensions utility or Gnome Tweaks > Extensions (install it via Ubuntu Software), go to the extension settings page, and finally set a picture for lock screen background.

That’s All. Enjoy! I hope you find this helpful.