Skip to content

feat: add login_box_opacity config option - #158

Open
jkinum wants to merge 8 commits into
rharish101:mainfrom
jkinum:feat/background-opacity
Open

feat: add login_box_opacity config option#158
jkinum wants to merge 8 commits into
rharish101:mainfrom
jkinum:feat/background-opacity

Conversation

@jkinum

@jkinum jkinum commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds login_box_opacity (float, 0.0–1.0, default 1.0) to the [background] section of regreet.toml
  • When set below 1.0, the login box becomes translucent and the wallpaper shows through
  • Default of 1.0 preserves existing fully-opaque behaviour — no breaking change

Why CSS alone can't do this

GTK4 CSS opacity on a GtkFrame is 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

File Change
src/config.rs login_box_opacity: f64 added to Background struct; Config::get_login_box_opacity() added
src/gui/templates.rs Login GtkFrame named login_frame for direct access
src/gui/component.rs login_frame.set_opacity() called during init with config value
regreet.sample.toml login_box_opacity documented with note on why CSS can't do this

Example config

[background]
path = "/usr/share/backgrounds/greeter.jpg"
fit = "Contain"
login_box_opacity = 0.82   # wallpaper visible through login box

jkinum and others added 6 commits May 4, 2026 10:22
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>
@rharish101

rharish101 commented May 5, 2026

Copy link
Copy Markdown
Owner

Hi, can you instead try this CSS with the ReGreet on the main branch?

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 regreet --style /path/to/your/style.css (replace /path/to/your/style.css with the path to the above CSS). You can also just run ReGreet in demo mode with this CSS.

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:

  1. The video background feature: that should be its own PR. EDIT: I added this myself based on your latest commit, thanks a lot for the code.
  2. Fedora packaging: I'd like to keep out the packaging stuff, since that's meant for distro maintainers (so you should send your code to them instead). I want to keep upstream only focused on the core code + the bare minimum needed to help distro maintainers.

jkinum and others added 2 commits June 21, 2026 18:54
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants