Add layout name in ags

This commit is contained in:
2024-07-10 23:00:26 +07:00
parent 4c48f36499
commit 4968c3a8e7
2 changed files with 13 additions and 3 deletions
+1 -3
View File
@@ -24,9 +24,7 @@ export const Bar = (monitor) =>
monitor,
labels: ["一", "二", "三", "四", "五", "六", "七", "八", "九"],
}),
// dwl.Layout({
// mon: monId,
// }),
wm.Layout({ monitor }),
wm.ClientLabel({ monitor }),
],
}),
+12
View File
@@ -66,6 +66,18 @@ const TagItem = ({ occupied, selected, urgent, i, output, label }) =>
child: Widget.Label({ label, className: "tags" }),
});
/** @param {{monitor: number } & import("types/widgets/label").LabelProps} props */
export const Layout = ({ monitor, ...props }) =>
Widget.Label(props).hook(
river,
(self) => {
const output = getOutput(monitor);
if (!output) return;
self.label = output.layout_name;
},
"changed",
);
/** @param {{monitor: number, fallback?: string} & import("types/widgets/label").LabelProps} props */
export const ClientLabel = ({ monitor, fallback = "", ...props }) =>
Widget.Label({