feat: add login_box_opacity config option - #158
Open
jkinum wants to merge 8 commits into
Open
Conversation
Add a `login_box_opacity` field (float, 0.0–1.0, default 1.0) to the `[background]` section in regreet.toml. When set below 1.0, the login box becomes translucent and the wallpaper shows through. CSS `opacity` on the GtkFrame widget is not respected by GTK4 at the theme rendering level, so this applies opacity via `Widget::set_opacity()` in Rust after widget init, which GTK4 does honour. Implementation: - `Background` struct gains `login_box_opacity: f64` with serde default 1.0 - `Config::get_login_box_opacity()` exposes the value - `templates.rs` names the login GtkFrame `login_frame` for direct access - `component.rs` calls `login_frame.set_opacity()` during init Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Builds ReGreet from this fork's source via Podman into a Fedora RPM. No external clone or source patches needed — CSS handles transparency. Includes greetd/cage config and a Hyprland-themed regreet.css. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change greeter→greetd user/group in systemd-tmpfiles.conf (Fedora uses greetd, not greeter) - Auto-deploy tmpfiles conf and create log/state dirs in build-and-install.sh - Remove clock_frame background CSS class so clock floats on wallpaper - Add JetBrainsMono Nerd Font, clock widget config to regreet.toml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Detect video extensions (.mp4, .webm, .mkv, .mov, .avi) in config and use gtk::MediaFile (GStreamer-backed) for looping video backgrounds; static images continue to use set_filename. Also fix regreet.toml which had shell-escaped quotes (\") making it invalid TOML — config was silently falling back to defaults on every launch. Switch wallpaper to VP9/WebM (no new dependencies; vp9dec is already in gstreamer1-plugins-good). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
Hi, can you instead try this CSS with the ReGreet on the window > overlay > frame:nth-child(2) {
opacity: 0.2;
}You will have to edit your config for greetd/Wayland compositor (the one that launches ReGreet) to run I tried this on my system (with Arch Linux), and it worked for me. If it doesn't work for you, maybe we have to instead debug why it doesn't work for you, which means that it wouldn't be a feature PR, rather a bugfix PR. As for the other things in this PR:
|
Convert the greeter window to a wlr-layer-shell surface so it can fill an output (groundwork for a multi-monitor login box). The layer-shell setup (overlay layer, all-edge anchors, exclusive keyboard, -1 exclusive zone) runs in a root constructor (LayerShellRoot::new_greeter) because relm4 shows an AsyncComponent's root before init() runs, so configuring layer-shell in the view! body is too late and the anchors are silently ignored (surface stays at its default 200x200). This spike is still single-window; per-output windows + shared greetd auth + hotplug are the next phase. Build: gtk4-layer-shell 0.7.1 (matches gtk4 ^0.10; 0.8.0 needs gtk4 0.11). Add gtk4-layer-shell-devel to the builder image and gtk4-layer-shell as a runtime dep. Switch build/extract to rootful podman -- rootless on Fedora 43 fails to chown cups-filesystem (a hard gtk4 dep) during rpm unpack. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pin the layer-shell login surface to a configured "primary" monitor instead of letting the compositor pick arbitrarily. regreet.toml gains a [monitors] primary ordered priority list, matched as a substring against each monitor's GDK description (make/model/serial/connector); the first currently-connected match wins, re-evaluated on every monitor add/remove so lid open/close moves the box deterministically. The description is read via the GObject property because the typed MonitorExt::description() getter (GDK 4.10) isn't bound by this gtk4-rs version. Removes the old single-window choose_monitor / MonitorRemoved / fullscreen_on_monitor path. No new crate deps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
login_box_opacity(float, 0.0–1.0, default1.0) to the[background]section ofregreet.toml1.0, the login box becomes translucent and the wallpaper shows through1.0preserves existing fully-opaque behaviour — no breaking changeWhy CSS alone can't do this
GTK4 CSS
opacityon aGtkFrameis not respected at the theme rendering level; the frame's background is painted before CSS compositing occurs.Widget::set_opacity()in Rust is honoured by GTK4 and achieves the intended effect.Implementation
src/config.rslogin_box_opacity: f64added toBackgroundstruct;Config::get_login_box_opacity()addedsrc/gui/templates.rsGtkFramenamedlogin_framefor direct accesssrc/gui/component.rslogin_frame.set_opacity()called during init with config valueregreet.sample.tomllogin_box_opacitydocumented with note on why CSS can't do thisExample config