Merge branch 'main' into ags-config
This commit is contained in:
commit
1f80786864
16 changed files with 324 additions and 138 deletions
23
home-manager/stvnliu/ags/config/hyprworkspaces.js
Normal file
23
home-manager/stvnliu/ags/config/hyprworkspaces.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const hyprland = await Service.import("hyprland")
|
||||
|
||||
const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`);
|
||||
|
||||
const Workspaces = () => Widget.EventBox({
|
||||
onScrollUp: () => dispatch('+1'),
|
||||
onScrollDown: () => dispatch('-1'),
|
||||
child: Widget.Box({
|
||||
children: Array.from({ length: 10 }, (_, i) => i + 1).map(i => Widget.Button({
|
||||
attribute: i,
|
||||
label: `${i}`,
|
||||
onClicked: () => dispatch(i),
|
||||
|
||||
class_name: i === hyprland.active.workspace.id ? "focused" : ""
|
||||
})),
|
||||
|
||||
// remove this setup hook if you want fixed number of buttons
|
||||
setup: self => self.hook(hyprland, () => self.children.forEach(btn => {
|
||||
btn.visible = hyprland.workspaces.some(ws => ws.id === btn.attribute);
|
||||
})),
|
||||
}),
|
||||
})
|
||||
export { Workspaces };
|
Loading…
Add table
Add a link
Reference in a new issue