mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
overview: add ws numbers
This commit is contained in:
parent
8d640a82d9
commit
9e8a840430
1 changed files with 14 additions and 2 deletions
|
|
@ -208,13 +208,19 @@ export default () => {
|
|||
},
|
||||
}
|
||||
})
|
||||
const WorkspaceNumber = (index) => Widget.Label({
|
||||
const WorkspaceNumber = ({ index, ...rest }) => Widget.Label({
|
||||
className: 'overview-tasks-workspace-number',
|
||||
label: `${index}`,
|
||||
css: `
|
||||
margin: ${Math.min(SCREEN_WIDTH, SCREEN_HEIGHT) * userOptions.overview.scale * userOptions.overview.wsNumMarginScale}px;
|
||||
font-size: ${SCREEN_HEIGHT * userOptions.overview.scale * userOptions.overview.wsNumScale}px;
|
||||
`,
|
||||
setup: (self) => self.hook(Hyprland.active.workspace, (self) => {
|
||||
// Update when going to new ws group
|
||||
const currentGroup = Math.floor((Hyprland.active.workspace.id - 1) / NUM_OF_WORKSPACES_SHOWN);
|
||||
self.label = `${currentGroup * NUM_OF_WORKSPACES_SHOWN + index}`;
|
||||
}),
|
||||
...rest,
|
||||
})
|
||||
const widget = Widget.Box({
|
||||
className: 'overview-tasks-workspace',
|
||||
|
|
@ -238,7 +244,13 @@ export default () => {
|
|||
overviewTick.setValue(!overviewTick.value);
|
||||
});
|
||||
},
|
||||
child: fixed,
|
||||
child: Widget.Overlay({
|
||||
child: Widget.Box({}),
|
||||
overlays: [
|
||||
WorkspaceNumber({ index: index, hpack: 'start', vpack: 'start' }),
|
||||
fixed
|
||||
]
|
||||
}),
|
||||
})],
|
||||
});
|
||||
const offset = Math.floor((Hyprland.active.workspace.id - 1) / NUM_OF_WORKSPACES_SHOWN) * NUM_OF_WORKSPACES_SHOWN;
|
||||
|
|
|
|||
Loading…
Reference in a new issue