snowflake/home/programs/ags/config/js/widgets/hyprland.js
notohh 502c926f9f
WIP: treewide: refactor to use flake-parts
first pass of my flake refactor using flake-parts
2024-04-16 21:02:33 -04:00

19 lines
550 B
JavaScript

import { Hyprland, Widget } from "../../import.js";
const Workspaces = () =>
Widget.Box({
class_name: "workspaces",
children: Hyprland.bind("workspaces").transform((ws) => {
return ws.map(({ id }) =>
Widget.Button({
on_clicked: () => Hyprland.sendMessage(`dispatch workspace ${id}`),
child: Widget.Label(`${id}`),
class_name: Hyprland.active.workspace
.bind("id")
.transform((i) => `${i === id ? "focused" : ""}`)
})
);
})
});
export { Workspaces };