git.lucas.co / cce-status-interface
status bar
git clone https://git.lucas.co/cce-status-interface.git

commit16bec7d1242a932b61f0dd91b58910164543ef11
parentc4d336b0e0
authorLucas Galante <[email protected]>
date2026-06-24 21:25
feat: trigger select-and-close via stdin command on super release modifier update

 src/main.rs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index e23e881..a2b1474 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1007,7 +1007,15 @@ impl cce_ui::engine::Application for StatusApp {
                 self.title = t;
             }
             CustomEvent::ModifiersUpdated(m) => {
-                self.super_pressed = m == "super";
+                let was_super = self.super_pressed;
+                self.super_pressed = m.contains("super");
+
+                if was_super && !self.super_pressed {
+                    if let Some(ref writer) = self.active_switcher_stdin {
+                        eprintln!("[switcher] Super modifier released (via status updates), triggering select and close");
+                        let _ = writer.0.send("__cce_switcher_select_and_close__\n".to_string());
+                    }
+                }
             }
             CustomEvent::SystemStatsUpdated(s) => {
                 self.stats = Some(s);