End-to-End Boot and Lockscreen Loop: GRUB, Plymouth, GDM, and Lockscreen
The previous three parts unified 99% of the post-login desktop experience—frosted glass, dual file managers, mixed CJK/Latin typography, input method, terminal CLI, Qt5 apps, editors, and Chrome all share the same dark frosted-glass aesthetic. Yet the moment you reboot or hit Super+L to lock your screen, the illusion shatters: a stark text-only GRUB menu, a jarring default boot splash, Ubuntu’s ever-present purple GDM login prompt, and an unblurred lockscreen.
Breaking a user-space tweak is easy to recover from—at worst you switch themes or restore ~/.config. Touching the bootloader and display manager is a different story: one bad edit can drop you into a black screen or stop the graphical greeter from starting altogether. That is why this part establishes one non-negotiable engineering rule for system-level customization: never overwrite package-managed system files; route every change through official extension mechanisms or isolated paths, and wrap every step with a one-command --restore rollback to factory defaults.
End-to-End Boot and Rollback Architecture
From pressing the power button to locking and unlocking your desktop during the day, a Linux workstation moves through five stages: GRUB boot menu → Plymouth kernel boot splash → GDM system login greeter → GNOME desktop session → user-space lockscreen.
To carry the same cool blue-violet sunset-island palette across every stage while keeping blast radius minimal, the full chain follows a layered forward apply + independent per-layer rollback design:
flowchart LR
G["GRUB (Tela Sunset)"] --> P["Plymouth (bgrt Dark Boot)"]
P --> GDM["GDM (update-alternatives Standalone gresource)"]
GDM --> D["GNOME Desktop (Fluent + Blur)"]
D --> L["Lockscreen (unlockDialogBackground)"]
L --> D
RB1["Rollback: apply-boot-theme.sh --restore"] -.-> G
RB1 -.-> P
RB2["Rollback: apply-gdm-theme.sh --restore"] -.-> GDM
RB3["Rollback: restore.sh & dconf reset"] -.-> D
RB3 -.-> L
Each layer has clean boundaries:
- Bootloader layer (GRUB + Plymouth): managed by
apply-boot-theme.sh, which snapshots stock settings on first run, supports--keep-plymouthto leave your existing splash intact, and provides--restorefor a complete revert. - System greeter layer (GDM): compiles a standalone
.gresourcebundle under/usr/local/share/gnome-shell/and mounts it via Ubuntu’s nativeupdate-alternativeswithout touching a single package-managed file. - User session layer (Desktop + Lockscreen): lives entirely in
$HOMEand userdconf, reverting in seconds via therestore.shsnapshot anddconfbackup created in Part 2.
Let’s walk through each stage and the real pitfalls encountered along the way.
Stage 1: GRUB Boot Menu Theming and the Progressive JPEG Pitfall
1. Theme Selection and Directory Isolation
For GRUB, we use Tela (1080p) from vinceliuice/grub2-themes (by the same author behind Fluent and Colloid). Its centered boot list and flat OS icons stay clean and understated. To keep it isolated from stock directories, deploy it to /boot/grub/themes/tela-sunset/ and swap in the same twilight sunset-island wallpaper (twilight-island-sea.jpg) used on the desktop:
1 | git clone --depth=1 https://github.com/vinceliuice/grub2-themes.git /tmp/grub2-themes |
2. Major Pitfall: Why Dropping the Raw Wallpaper into GRUB Gives a Black Screen
Copying ~/Pictures/Wallpapers/Sunset/twilight-island-sea.jpg straight to /boot/grub/themes/tela-sunset/background.jpg looks like the obvious shortcut, but it fails in practice for two reasons:
- The raw file is 11 MB: GRUB runs before the kernel initializes GPU acceleration. Decoding an 11 MB high-resolution image on a single CPU thread noticeably delays menu rendering and puts pressure on the framebuffer.
- The real killer—Progressive JPEG: many high-res photography wallpapers are saved as progressive JPEGs (
SOF2marker, multi-scan rendering) for faster web loading. GRUB’s minimal built-injpegdecoder only reliably supports standard Baseline JPEG (SOF0). When fed a progressive JPEG, it often fails silently, leaving white menu text floating over a solid black void with the entire background missing.
You can check the encoding in one command with file:
1 | file ~/Pictures/Wallpapers/Sunset/twilight-island-sea.jpg |
3. Preprocessing with Python Pillow: Crop, Darken, and Force Baseline Output
The reliable fix is a 3-step Pillow (PIL) preprocessing pass:
- Center-crop to
1920x1080: matchesGRUB_GFXMODE=1920x1080pixel-for-pixel so GRUB never performs low-quality boot-time scaling. - Slightly darken to
0.78brightness:ImageEnhance.Brightness(...).enhance(0.78)tames bright highlights so white GRUB boot entries stay crisp and legible while preserving the twilight sea palette. - Force
progressive=Falsefor Baseline JPEG: shrinks the original 11 MB wallpaper down to roughly 246 KB, rendering instantaneously on cold boot.
1 | #!/usr/bin/env python3 |
Verify both the encoding and file size right after conversion:
1 | file /boot/grub/themes/tela-sunset/background.jpg |
Confirm the output reports baseline and a size around 246 KB before moving on.
4. Tested /etc/default/grub Settings
Set these four keys in /etc/default/grub so single-OS Ubuntu does not hide the menu by default and locks the framebuffer to 1080p:
1 | GRUB_TIMEOUT_STYLE=menu |
After saving, run sudo update-grub to regenerate /boot/grub/grub.cfg.

Stage 2: Minimal Dark Plymouth Splash & apply-boot-theme.sh
Once GRUB hands off to the kernel, Plymouth takes over the graphical boot splash.
Instead of wrestling with flashy third-party Plymouth themes that stutter or break across upgrades, the cleanest and least invasive choice is Ubuntu’s built-in bgrt theme. It reads the vendor logo directly from the motherboard’s UEFI ACPI BGRT (Boot Graphics Resource Table) and places a minimal dark spinner underneath on a pure black background—transitioning seamlessly between dark GRUB and dark GDM.
Switching manually takes just two commands:
1 | sudo update-alternatives --set default.plymouth /usr/share/plymouth/themes/bgrt/bgrt.plymouth |
To make GRUB wallpaper processing, idempotent /etc/default/grub edits, Plymouth switching, and rollback repeatable, we wrap the whole workflow into apply-boot-theme.sh:
- One-time initial snapshot: saves the original
/etc/default/grubanddefault.plymouthtarget under/var/backups/ubuntu-gnome-boot-theme/without overwriting the factory snapshot on subsequent runs. --keep-plymouthflag: if you prefer your current boot animation—or run on hardware without a UEFI BGRT logo—pass this flag to theme GRUB only without rebuildinginitramfs.--restoreone-command rollback: restores/etc/default/grub, removes the custom theme directory, resets the original Plymouth alternative, and re-runs bothupdate-grubandupdate-initramfs -u.
Expand full apply-boot-theme.sh (with --keep-plymouth and --restore)
1 |
|
Stage 3: Non-Destructive GDM Theming (update-alternatives + Permission Isolation)
1. Core Rule: Why You Must Never Overwrite the Package-Managed .gresource
Plenty of older Ubuntu GDM tutorials start with something like this:
1 | # ❌ Anti-pattern: never do this! |
Overwriting that file in place causes two serious problems:
- Silently wiped on upgrades:
/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresourcebelongs toyaru-theme-gnome-shell. The very nextapt upgradequietly resets your login screen back to stock purple. - One typo breaks login: if your patched CSS has a syntax error or the resource manifest drops an icon, GDM fails to start and you are stuck switching to a TTY to reinstall the
.debpackage.
Ubuntu already provides an official update-alternatives extension point for GDM targeting /usr/share/gnome-shell/gdm-theme.gresource. By compiling our custom theme into a standalone /usr/local/share/gnome-shell/gdm-sunset-theme.gresource and registering it at a higher priority than Yaru, rollback is a single update-alternatives --remove command—zero residue and immune to package updates.
2. Three-Step Non-Destructive Workflow
Step 1: Extract Stock Yaru, Inject CSS, and Compile a Standalone Bundle
GDM styles live inside a compiled GLib binary archive (GResource). Use the built-in gresource CLI to unpack /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource into a temporary directory, copy in the preprocessed sunset background (gdm-sunset-bg.jpg), and append dark frosted-glass rules for #lockDialogGroup and .login-dialog to the extracted stylesheets:
1 | /* Append to the end of the extracted GDM theme stylesheets */ |
Next, generate a .gresource.xml manifest listing every extracted file plus gdm-sunset-bg.jpg, and compile it with glib-compile-resources (from libglib2.0-dev-bin) into /usr/local/share/gnome-shell/gdm-sunset-theme.gresource.
Step 2: Register via update-alternatives and Verify
Register the compiled bundle as a higher-priority alternative for gdm-theme.gresource (priority 50, beating Yaru’s 15 and the default GNOME Shell theme’s 10):
1 | sudo update-alternatives --install \ |
Verify the active link immediately with --display:
1 | update-alternatives --display gdm-theme.gresource |
Confirm that auto mode points to /usr/local/share/gnome-shell/gdm-sunset-theme.gresource while stock priorities 15 and 10 remain intact:
1 | gdm-theme.gresource - auto mode |
Step 3: Permission Isolation + Dedicated GDM dconf Database
Right after installing the .gresource, you will likely notice the login screen still shows the stock black cursor and default Ubuntu font instead of Inter. That comes down to Linux permission isolation: GDM runs as the restricted gdm system user, while Ubuntu sets user home directories (/home/<user>) to mode 750, so gdm cannot read anything inside ~/.local/share/icons or ~/.local/share/fonts.
The clean solution is to mirror only the required cursor and font files into system-wide read-only paths:
- Cursor theme: copy
Bibata-Modern-Iceto/usr/share/icons/Bibata-Modern-Ice. - Fonts: copy
Inter(both variable fonts:Inter[opsz,wght].ttfandInter-Italic[opsz,wght].ttf) andHarmonyOS Sans SC(Light,Regular,Medium,Bold) to/usr/local/share/fonts/gdm-ui/, enforce0644/0755permissions, and rebuild the system cache withsudo fc-cache -fv. - Write a dedicated GDM
dconfoverride at/etc/dconf/db/gdm.d/01-custom-theme(exact 6 tested lines):
1 | [org/gnome/desktop/interface] |
Verify that /etc/dconf/profile/gdm includes system-db:gdm, then run sudo dconf update to compile the override into /etc/dconf/db/gdm.
3. Bash Engineering Postmortem: set -u Colliding with local + trap RETURN
While automating the GDM build pipeline into a script, I ran into a subtle Bash bug worth unpacking.
The symptom: following standard defensive scripting habits, the script started with set -euo pipefail. Inside the .gresource build function, I added what looked like tidy automatic temp-directory cleanup:
1 | # ❌ Buggy pattern: triggers "workdir: unbound variable" after the function returns |
In practice, build_gresource compiled the .gresource without error—and then the script abruptly aborted when a subsequent function returned:
1 | ./apply-gdm-theme.sh: line 42: workdir: unbound variable |
That single error cut off the entire && install_alternative && update_gdm_dconf chain halfway through!
Root cause:
- Bash
traphandlers are not lexical closures—they evaluate dynamically at trigger time. trap '...' RETURNshares a single global slot in the shell process and does not automatically clear itself after the first function returns. Whenever later functions return, the previously registeredRETURNtrap fires again.- By then,
local workdirhas gone out of scope and been destroyed. Withset -u(nounset) enabled, expanding"$workdir"raises an unbound-variable error and terminates the script.
The clean fix:
- Preferred approach (zero side effects): never bind a
RETURNtrap to a function-local variable. Clean up explicitly inside the function, backed by a script-globalWORK_DIR=""and a process-leveltrap cleanup EXITsafety net. - Alternative (if you insist on a local
RETURNtrap): always use defensive expansion${workdir:-}and immediately clear the trap inside itself withtrap - RETURN.
1 | # ✅ Recommended pattern: script-level global + EXIT safety net, avoiding RETURN trap scoping bugs |
4. Complete Non-Destructive GDM Deploy & --restore Script
Here is the sanitized, production-tested apply-gdm-theme.sh incorporating all of the safeguards above:
Expand full non-destructive GDM deploy and --restore script
1 |
|

Stage 4: Seamless User-Space Lockscreen Alignment
After theming GDM, there is one easily missed distinction when you press Super+L during the workday: the GDM login screen only runs at boot and logout under the gdm system user, whereas the lockscreen runs inside your own logged-in GNOME Shell session.
To match the lockscreen to the exact same twilight sunset frosted-glass aesthetic as the desktop and GDM, pair two settings:
- Point the
unlockDialogBackgroundextension (dconfpath/org/gnome/shell/extensions/unlock-dialog-background/) totwilight-island-sea.jpgfor both light and dark URIs (replace/home/<user>with your actual$HOMEpath):
1 | dconf write /org/gnome/shell/extensions/unlock-dialog-background/picture-uri \ |
- Confirm
Blur my Shelllockscreen blur (enabled back in Part 2):
1 | dconf write /org/gnome/shell/extensions/blur-my-shell/lockscreen/blur true |
Verify both dconf subtrees right away:
1 | dconf dump /org/gnome/shell/extensions/unlock-dialog-background/ |
Hit Super+L to test: the desktop fades smoothly into a softly blurred twilight sunset lockscreen, and entering your password snaps cleanly back into your workspace. The visual loop from power button to daily lockscreen is now completely closed.

Wrap-Up: Global Rollback Matrix & Dual-Machine Verification Checklist
Across these four visual-unification guides, we touched the desktop shell, fonts, IME, terminal CLI, Qt5, browser, bootloader, and login greeter. To ensure you can revert any individual layer on demand—or replicate the entire setup on a fresh machine in 10 minutes, here are two reference tables to keep on hand.
1. Layered One-Command Rollback Matrix
| Layer | Components & Modified Paths | One-Command Rollback | How It Takes Effect |
|---|---|---|---|
| 1. Desktop / GTK / dconf | Fluent-round-Dark, Colloid-Dark, Blur my Shell, ~/.config/gtk-3.0/gtk.css, ~/.config/gtk-4.0/gtk.css |
Run ~/.local/share/desktop-theme-backup-<timestamp>/restore.sh generated in Part 2 |
nautilus -q + log out and back in |
| 2. Fonts / fontconfig / IME / Shortcuts | ~/.config/fontconfig/fonts.conf, ~/.config/fcitx5/, show-desktop binding |
Move fonts.conf aside and run fc-cache -fv; restore ~/.config/fcitx5/ backup and run fcitx5-remote -r; gsettings reset org.gnome.desktop.wm.keybindings show-desktop |
Immediate (restart open apps for default fonts) |
| 3. Terminal CLI / Qt5 / Editors | eza / bat / btop / fastfetch, QT_QPA_PLATFORMTHEME=qt5ct, ~/.config/qt5ct/, VS Code & Cursor settings.json |
Comment out CLI aliases and QT_QPA_PLATFORMTHEME in .zshrc, move ~/.config/qt5ct/ aside, restore editor settings.json backups |
Open a new shell / restart affected apps |
| 4. Chrome Dark Unification | ~/.config/google-chrome/Default/Preferences |
Close all Chrome processes and run ./apply-chrome-theme.sh --restore |
Relaunch Chrome |
| 5. GDM Login Screen | /usr/local/share/gnome-shell/gdm-sunset-theme.gresource, /etc/dconf/db/gdm.d/01-custom-theme, /usr/local/share/fonts/gdm-ui/ |
Run sudo ./apply-gdm-theme.sh --restore (removes alternatives entry, dconf override, and rebuilds caches) |
Next logout or GDM restart |
| 6. GRUB / Plymouth | /etc/default/grub, /boot/grub/themes/tela-sunset/, default.plymouth |
Run sudo ./apply-boot-theme.sh --restore (restores /etc/default/grub, Plymouth, and re-runs update-grub + update-initramfs -u) |
Next reboot |
2. Dual-Machine (Ubuntu 22.04 LTS / 24.04 LTS) Verification Checklist
Whether you replicated this setup on Ubuntu 22.04.5 LTS (GNOME 42.9 + Blur my Shell v47 + GTK3 Nautilus) or Ubuntu 24.04.5 LTS (GNOME 46.0 + Blur my Shell v78 + GTK4 Nautilus), run this read-only verification block to inspect every critical piece at a glance:
1 | # 1. Desktop theme, cursor, font, and shortcut gsettings baseline |
💡 Cross-version replication notes: When syncing between Ubuntu 22.04 and 24.04, fonts, icons,
fontconfig, IME, terminal CLI tools,qt5ct, Chrome, GRUB/Plymouth, and GDM configs are 100% reusable. Only two spots need version-specific adjustments:
- Nautilus opaque CSS override path:
~/.config/gtk-3.0/gtk.csson 22.04 vs.~/.config/gtk-4.0/gtk.csson 24.04 (wrapped via@importto preserve theme symlinks).- Blur my Shell parameters:
opacity=190/brightness=1.0/hacks-level=3on 22.04 (v47, eliminates vertical striping on GNOME 42 X11 + discrete GPU; laptops can use2if preferred), vs.opacity=205/pipeline_defaultbrightness=0.6withdynamic-opacityoff on 24.04 (v78).
From the darkened Tela sunset GRUB menu at power-on, through the minimal dark bgrt splash and frosted GDM greeter, into the day/night sunset frosted-glass desktop and unified app stack—the full Ubuntu GNOME visual pipeline is now complete.
Next up—Terminal Dev Suite: If you also write C/C++ or preview Markdown inside terminal Vim, continue to Part 6 👉 Ubuntu vimplus Setup and Configuration Guide (building a lightweight terminal IDE with
vimplus+coc.nvim+clangdandglow).
Series Navigation
| # | Article | Core Topics |
|---|---|---|
#0 |
Ubuntu Workstation Setup · Series Index | End-to-end architecture blueprint, visual design goals, and dual-machine baseline |
#1 |
Ubuntu 22.04 GNOME Desktop Configuration Guide | Base extensions, Extension Manager, and initial desktop ergonomics |
#2 |
Ubuntu GNOME Dark Frosted-Glass Desktop Framework and Dual File Manager Blur Opacity Fix (22.04 / 24.04) | Fluent + Colloid + dynamic wallpaper, Blur my Shell tuning, and Nautilus/Nemo opacity fix |
#3 |
Font Stack, Strict fontconfig Binding, fcitx5, and Shortcut Pitfalls |
Inter + HarmonyOS Sans SC + Sarasa, strong binding override, and Chrome Ctrl+C / Win+D fixes |
#4 |
Terminal CLI, Qt5 Unification, VS Code/Cursor, and Chrome Alignment | eza/bat/btop/fastfetch, qt5ct palette alignment, editors, and offline-safe Chrome script |
#5 |
End-to-End Boot and Lockscreen Loop: GRUB, Plymouth, GDM, and Lockscreen (Current post) | GRUB progressive JPEG fix, Plymouth bgrt, non-destructive GDM, lockscreen loop, and global rollback matrix |
#6 |
Ubuntu vimplus Setup and Configuration Guide | Terminal dev suite: vimplus + coc.nvim + clangd and Markdown preview |
#7 |
No Neovim Required: Non-Invasively Turn Classic Vim 9 + vimplus into a Modern Dark Frosted-Glass Editor | Transparent Catppuccin Mocha, opaque rounded popups, pill status line, and large-file freeze protection |
#8 |
End-to-End Ubuntu Dev Tools Visual & Workflow Unification: VS Code, Cursor, tmux, Git Delta, fzf, and Typora | VS Code/Cursor polish, plugin-free tmux pill status bar, delta/fzf/fd/zoxide chain, and Typora/Guake/gedit alignment |








