diff --git a/Cargo.lock b/Cargo.lock index 6e58f10..01c554d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -472,6 +472,7 @@ dependencies = [ "tokio-stream", "tokio-util", "unescape", + "unindent", "wait-timeout", "x11rb", "yuck", @@ -2254,6 +2255,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +[[package]] +name = "unindent" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7" + [[package]] name = "utf8-ranges" version = "1.0.4" diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index db02853..e26d681 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -50,6 +50,7 @@ nix = "0.20" smart-default = "0.6" simple-signal = "1.1" unescape = "0.1" +unindent = "0.1" tokio = { version = "1.0", features = ["full"] } tokio-stream = "0.1" diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 3be328f..0f255ad 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -543,6 +543,7 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { prop(text: as_string, limit_width: as_i32 = i32::MAX) { let text = text.chars().take(limit_width as usize).collect::(); let text = unescape::unescape(&text).context(format!("Failed to unescape label text {}", &text))?; + let text = unindent::unindent(&text); gtk_widget.set_text(&text); }, // @prop markup - Pango markup to display