diff --git a/environments/hyprland/hyprland.conf b/environments/hyprland/hyprland.conf index 9021264..df02e45 100644 --- a/environments/hyprland/hyprland.conf +++ b/environments/hyprland/hyprland.conf @@ -1,5 +1,4 @@ general { - resize_on_border = true layout = master col.active_border = rgb(94e2d5) diff --git a/modules/wm/ags/modules/wm.js b/modules/wm/ags/modules/wm.js index 62f16df..222a413 100644 --- a/modules/wm/ags/modules/wm.js +++ b/modules/wm/ags/modules/wm.js @@ -8,6 +8,9 @@ const getMonitorName = (monitor) => { return display.get_default_screen().get_monitor_plug_name(monitor); }; +/** @type {Record} */ +const urgents = {} + /** @param {{monitor: number, labels: string[]} & import("types/widgets/box").BoxProps} props */ export const Tags = ({ monitor, labels, ...props }) => { const monName = getMonitorName(monitor); @@ -23,7 +26,14 @@ export const Tags = ({ monitor, labels, ...props }) => { }, }), ), - setup: (self) => + setup: (self) => { + self.hook(hyprland, (_, address) => { + const client = hyprland.getClient(address); + if (!client) return; + const ws = client.workspace.id; + urgents[ws] = true; + }, "urgent-window"); + self.hook(hyprland, () => self.children.forEach((btn) => { const mon = hyprland.monitors.find((x) => x.name === monName); @@ -31,7 +41,8 @@ export const Tags = ({ monitor, labels, ...props }) => { const occupied = (ws?.windows ?? 0) > 0; const selected = mon?.activeWorkspace?.id === btn.attribute; - const urgent = false; + if (selected) urgents[btn.attribute] = false; + const urgent = urgents[btn.attribute]; btn.visible = occupied || selected; btn.class_names = [ @@ -39,7 +50,8 @@ export const Tags = ({ monitor, labels, ...props }) => { urgent ? "secondary" : "", ]; }), - ), + ); + }, }); };