diff --git a/scripts/i3status/Cargo.toml b/scripts/i3status/Cargo.toml index 3848e04..1b4b5ad 100644 --- a/scripts/i3status/Cargo.toml +++ b/scripts/i3status/Cargo.toml @@ -12,3 +12,4 @@ i3status-rs = { git = "https://github.com/greshake/i3status-rust.git" } serde_json = "1.0.96" tokio = "1.28.1" toml = "0.7.4" +unicode-segmentation = "1.10.1" diff --git a/scripts/i3status/src/main.rs b/scripts/i3status/src/main.rs index f4c32c1..4f9baf6 100644 --- a/scripts/i3status/src/main.rs +++ b/scripts/i3status/src/main.rs @@ -1,4 +1,5 @@ use std::sync::Arc; +use unicode_segmentation::UnicodeSegmentation; use i3status_rs::{ blocks, @@ -19,7 +20,7 @@ use i3status_rs::{ async fn main() { if let Err(e) = try_main().await { let err_widget = Widget::new() - .with_text(e.to_string().chars().collect_pango_escaped()) + .with_text(e.to_string().graphemes(true).collect_pango_escaped()) .with_state(State::Critical); serde_json::to_writer(