feat: Default-Wallpaper-Fallback und neues Wallpaper

Greeter fällt auf mitgeliefertes Package-Wallpaper zurück, wenn kein
Background konfiguriert ist. Wallpaper ersetzt durch Daniel Leone's
"Snowy Mountain" (Unsplash License).
This commit is contained in:
nevaforget 2026-03-26 12:14:10 +01:00
parent 0f72df8603
commit 9a964aaecb
5 changed files with 12 additions and 7 deletions

View File

@ -41,5 +41,6 @@ uv run moongreet
- `users.py` — Benutzer aus /etc/passwd, Avatare, GTK-Themes - `users.py` — Benutzer aus /etc/passwd, Avatare, GTK-Themes
- `sessions.py` — Wayland/X11 Sessions aus .desktop Files - `sessions.py` — Wayland/X11 Sessions aus .desktop Files
- `power.py` — Reboot/Shutdown via loginctl - `power.py` — Reboot/Shutdown via loginctl
- `greeter.py` — GTK4 UI (Overlay-Layout) - `i18n.py` — Locale-Erkennung (LANG / /etc/locale.conf) und String-Tabellen (DE/EN)
- `greeter.py` — GTK4 UI (Overlay-Layout), Faillock-Warnung nach 2 Fehlversuchen
- `main.py` — Entry Point, GTK App, Layer Shell Setup - `main.py` — Entry Point, GTK App, Layer Shell Setup

View File

@ -2,7 +2,7 @@
## wallpaper.jpg ## wallpaper.jpg
- **Title**: Canyon Mountains on Night Sky - **Title**: Snowy Mountain
- **Author**: eberhard grossgasteiger - **Author**: Daniel Leone
- **Source**: https://www.pexels.com/photo/canion-mountains-on-night-sky-2098428/ - **Source**: https://unsplash.com/de/fotos/snowy-mountain-g30P1zcOzXo
- **License**: Pexels License (free for personal and commercial use) - **License**: Unsplash License (free for personal and commercial use, attribution not required)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB

View File

@ -25,6 +25,7 @@ LAST_USER_PATH = Path("/var/cache/moongreet/last-user")
FAILLOCK_MAX_ATTEMPTS = 3 FAILLOCK_MAX_ATTEMPTS = 3
PACKAGE_DATA = files("moongreet") / "data" PACKAGE_DATA = files("moongreet") / "data"
DEFAULT_AVATAR_PATH = PACKAGE_DATA / "default-avatar.svg" DEFAULT_AVATAR_PATH = PACKAGE_DATA / "default-avatar.svg"
DEFAULT_WALLPAPER_PATH = PACKAGE_DATA / "wallpaper.jpg"
AVATAR_SIZE = 128 AVATAR_SIZE = 128
@ -69,9 +70,12 @@ class GreeterWindow(Gtk.ApplicationWindow):
self.set_child(overlay) self.set_child(overlay)
# Background wallpaper (blurred and darkened) # Background wallpaper (blurred and darkened)
if self._config.background and self._config.background.exists(): bg_path = self._config.background
if not bg_path or not bg_path.exists():
bg_path = Path(str(DEFAULT_WALLPAPER_PATH))
if bg_path.exists():
background = Gtk.Picture() background = Gtk.Picture()
background.set_filename(str(self._config.background)) background.set_filename(str(bg_path))
background.set_content_fit(Gtk.ContentFit.COVER) background.set_content_fit(Gtk.ContentFit.COVER)
background.set_hexpand(True) background.set_hexpand(True)
background.set_vexpand(True) background.set_vexpand(True)