JakeStanger / ironbar

Customisable Wayland gtk bar written in Rust.
https://crates.io/crates/ironbar
MIT License
560 stars 47 forks source link

feat: add `.urgent` workspace css class #735

Open Rodrigodd opened 5 days ago

Rodrigodd commented 5 days ago

Allow highlighting a workspace which contains a window that triggered a urgent event, i.e., requests attention. In my case, I see it happens when I clink a link and it opens in a new tab on firefox, and when displaying a BEL character in some terminal emulators (at least in alacritty).

You can test it by running

sleep 1 && tput bel

in alacritty, and switching to another workspaces before the sleep expires.

I implemented it for both Sway and Hyprland. Sway keep track of a urgent flag for each client, and notify ironbar about changes. Hyprland or the other hand only contains a urgent event that triggers once, so I clean the urgent state of a workspace whenever it is focused.

Rodrigodd commented 4 days ago

Revised everything now. Fixed a typo in the docs, remove the dbg! usage, and fixed some non-formated code inside a macro.

JakeStanger commented 4 days ago

Thanks for this. This looks good, I'll test it when I can and will approve once I've confirmed it working as expected.