aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/config.rs6
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 {