working bar
This commit is contained in:
parent
ed206ad7e5
commit
2c9ff9db2f
8 changed files with 121 additions and 126 deletions
24
widget/workspaces.tsx
Normal file
24
widget/workspaces.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import Hyprland from "gi://AstalHyprland"
|
||||
import { bind, } from "astal"
|
||||
|
||||
export default function Workspaces() {
|
||||
const hypr = Hyprland.get_default()
|
||||
|
||||
return <box cssClasses={["Workspaces"]}>
|
||||
{bind(hypr, "workspaces").as((workspaces) =>
|
||||
workspaces
|
||||
.filter(ws => !(ws.id >= -99 && ws.id < -2))
|
||||
.sort((a, b) => a.id - b.id)
|
||||
.map((ws) => (
|
||||
<button
|
||||
onClicked={() => ws.focus()}
|
||||
cssClasses={bind(hypr, "focusedWorkspace").as((active) =>
|
||||
ws === active ? ["focused"] : [],
|
||||
)}
|
||||
>
|
||||
{ws.id}
|
||||
</button>
|
||||
)),
|
||||
)}
|
||||
</box >
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue