about summary refs log tree commit diff
path: root/src/module/i3_mode.rs
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-11-25 04:26:26 -0700
committerIrene Knapp <ireneista@irenes.space>2026-11-25 04:26:26 -0700
commit3add32f831f40010700efc324f8f85c481eaf43d (patch)
treec66d9d4edf91c4b13f8df551ce50bf3efb615ef1 /src/module/i3_mode.rs
parentb65303ede0750e9d83df4d2c5df67f143c9171c4 (diff)
the i3 mode module now gets the name of the current mode at startup
rather than saying "unknown"

Force-Push: yes
Change-Id: Ib48db8f7e12663cd2f312cc2ae2b0a608575b005
Diffstat (limited to 'src/module/i3_mode.rs')
-rw-r--r--src/module/i3_mode.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/module/i3_mode.rs b/src/module/i3_mode.rs
index c1b6484..96862eb 100644
--- a/src/module/i3_mode.rs
+++ b/src/module/i3_mode.rs
@@ -1,6 +1,8 @@
 use crate::error::{ Error, Result };
 use crate::facility::{ FacilityMap, FacilityType };
-use crate::facility::i3::{ parse_change_string, EventType, I3 };
+use crate::facility::i3::{
+  parse_change_string, parse_name_string, EventType, I3
+};
 use crate::module::{ CreatableModule, Module };
 
 use std::sync::Arc;
@@ -36,7 +38,8 @@ impl CreatableModule for I3ModeModule {
       return Err(Error::custom("Unable to subscribe to i3 mode changes."));
     }
 
-    let current_mode = Arc::new(Mutex::new("unknown".to_string()));
+    let current_mode = Arc::new(Mutex::new(parse_name_string(
+                           i3.command(12, "").await?.as_bytes())?));
 
     let update_task = executor.spawn(update_loop(receiver,
                                                  Arc::clone(&current_mode),