diff options
| author | duckyriley <[email protected]> | 2026-11-27 02:46:04 +0800 |
|---|---|---|
| committer | duckyriley <[email protected]> | 2026-11-27 02:46:04 +0800 |
| commit | 6cffcb0a1cf258521ae847c45819228241b9bbe6 (patch) | |
| tree | ffe4106a43026baee5dd62bef9b045c98ea66a4a /src/config.rs | |
| parent | 7a7e3da4103f8dcf3c69f0cc6b9d0cb666e89ce9 (diff) | |
| download | ducky-6cffcb0a1cf258521ae847c45819228241b9bbe6.tar.gz ducky-6cffcb0a1cf258521ae847c45819228241b9bbe6.zip | |
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 <[email protected]>
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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<String, String>, 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 { |