Skip to content

Commit

Permalink
Also trigger workspace update on focusedmon
Browse files Browse the repository at this point in the history
  • Loading branch information
vpzomtrrfrt committed Sep 6, 2024
1 parent d44a07d commit f861e02
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/wm_info_provider/hyprland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ fn hyprland_cb(conn: &mut Connection<State>, state: &mut State) -> io::Result<()
match hyprland.ipc.next_event() {
Ok(event) => {
if let Some(active_ws) = event.strip_prefix("workspace>>") {
hyprland.active_id = active_ws
.parse()
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
updated = true;
} else if let Some(data) = event.strip_prefix("focusedmon>>") {
let active_ws = data
.split_once(',')
.ok_or_else(|| {
io::Error::new(io::ErrorKind::InvalidData, "Too few fields in data")
})?
.1;

hyprland.active_id = active_ws
.parse()
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
Expand Down

0 comments on commit f861e02

Please sign in to comment.