make bar show workspaces 1-10
This commit is contained in:
parent
86b08ef9ea
commit
608c48d139
1 changed files with 11 additions and 15 deletions
|
@ -81,17 +81,13 @@ function Media() {
|
||||||
function Workspaces() {
|
function Workspaces() {
|
||||||
const hypr = Hyprland.get_default()
|
const hypr = Hyprland.get_default()
|
||||||
|
|
||||||
|
const workspaceButtons: number[] = (Array.from({ length: 10 }, (_, id) => id + 1))
|
||||||
|
|
||||||
return <box className="Workspaces">
|
return <box className="Workspaces">
|
||||||
{bind(hypr, "workspaces").as(wss => wss
|
{workspaceButtons.map (workspace =>
|
||||||
.sort((a, b) => a.id - b.id)
|
|
||||||
.map(ws => (
|
|
||||||
<button
|
<button
|
||||||
className={bind(hypr, "focusedWorkspace").as(fw =>
|
className={bind(hypr, "focusedWorkspace").as(fw => workspace === fw.id ? "focused" : "")}
|
||||||
ws === fw ? "focused" : "")}
|
>{workspace}</button>
|
||||||
onClicked={() => ws.focus()}>
|
|
||||||
{ws.id}
|
|
||||||
</button>
|
|
||||||
))
|
|
||||||
)}
|
)}
|
||||||
</box>
|
</box>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue