Fix hyprland rules/window orders & addback layout count

This commit is contained in:
2025-05-18 21:28:20 +02:00
parent 4e73628d6c
commit 32942aa0d0
3 changed files with 26 additions and 5 deletions
+1
View File
@@ -25,6 +25,7 @@ export const Bar = (monitor) =>
monitor,
labels: ["一", "二", "三", "四", "五", "六", "七", "八", "九"],
}),
wm.Layout({ monitor }),
wm.ClientLabel({ monitor }),
],
}),
+19
View File
@@ -43,6 +43,25 @@ export const Tags = ({ monitor, labels, ...props }) => {
});
};
/** @param {{monitor: number } & import("types/widgets/label").LabelProps} props */
export const Layout = ({ monitor, ...props }) => {
const monName = getMonitorName(monitor);
return Widget.Label({
className: "module",
...props,
}).hook(
hyprland,
(self) => {
const mon = hyprland.monitors.find((x) => x.name === monName);
const ws = hyprland.workspaces.find(
(x) => x.id === mon?.activeWorkspace?.id,
);
self.label = ws?.windows ? `[${ws?.windows}]` : "";
},
"changed",
);
}
/** @param {{monitor: number, fallback?: string} & import("types/widgets/label").LabelProps} props */
export const ClientLabel = ({ monitor, fallback = "", ...props }) => {
const monName = getMonitorName(monitor);