snowflake/home/ags/config/js/widgets/hyprland.js
notohh a9626cfd89
All checks were successful
flake check / check (push) Successful in 9m47s
fmt check / check (push) Successful in 1m14s
ags: updates
2024-01-03 17:08:17 -05:00

17 lines
No EOL
530 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
}