summaryrefslogtreecommitdiff
path: root/src/wm_info_provider
diff options
context:
space:
mode:
Diffstat (limited to 'src/wm_info_provider')
-rw-r--r--src/wm_info_provider/hyprland.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wm_info_provider/hyprland.rs b/src/wm_info_provider/hyprland.rs
index 6fbfc30..29b86b3 100644
--- a/src/wm_info_provider/hyprland.rs
+++ b/src/wm_info_provider/hyprland.rs
@@ -83,6 +83,15 @@ fn hyprland_cb(conn: &mut Connection<State>, state: &mut State) -> io::Result<()
.parse()
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
updated = true;
+ } else if let Some(data) = event.strip_prefix("focusedmon>>") {
+ let (_monitor, active_ws) = data.split_once(',').ok_or_else(|| {
+ io::Error::new(io::ErrorKind::InvalidData, "Too few fields in data")
+ })?;
+
+ hyprland.active_id = active_ws
+ .parse()
+ .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
+ updated = true;
} else if event.contains("workspace>>") {
hyprland.workspaces = hyprland.ipc.query_sorted_workspaces()?;
updated = true;