From 6cffcb0a1cf258521ae847c45819228241b9bbe6 Mon Sep 17 00:00:00 2001 From: duckyriley Date: Fri, 27 Nov 2026 02:46:04 +0800 Subject: Add opacity option for a translucent, blurred window `opacity` (0.2-1, default 1) sets the window background alpha. Below 1 the window uses a blurred background so the desktop shows through; inactive tabs no longer paint an opaque background over it. Co-Authored-By: Claude Opus 5.5 --- src/config.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 6181d77..2edb8a5 100644 --- a/src/config.rs +++ b/src/config.rs @@ -17,6 +17,8 @@ pub struct Config { pub muted: u32, pub border: u32, pub show_status_bar: bool, + /// Window background opacity; below 1.0 the desktop shows through, blurred. + pub opacity: f32, pub shortcuts: HashMap, pub width: f32, pub height: f32, @@ -213,6 +215,7 @@ impl Config { .map_err(|e| anyhow::anyhow!(e.to_string()))?, )?, show_status_bar: get!("show_status_bar"), + opacity: get!("opacity"), shortcuts: get!("shortcuts"), width: get!("width"), height: get!("height"), @@ -233,11 +236,12 @@ impl Config { || !(0.0..=100.0).contains(&c.padding) || !(400.0..=4000.0).contains(&c.width) || !(300.0..=3000.0).contains(&c.height) + || !(0.2..=1.0).contains(&c.opacity) || c.palette.len() != 16 || c.scrollback > 1_000_000 { bail!( - "invalid font, spacing, window dimensions, scrollback, or palette (requires 16 colors)" + "invalid font, spacing, window dimensions, opacity (0.2-1), scrollback, or palette (requires 16 colors)" ); } for (key, action) in &c.shortcuts { -- cgit v1.2.3