Skip to content

How to use split workspaces plugin #406

Closed Answered by nonetrix
nonetrix asked this question in Q&A
Discussion options

You must be logged in to vote

Underestimated the power of just asking ChatGPT tbh

function Workspaces(monitor) {
    const activeId = hyprland.active.workspace.bind("id")
    const workspaces = hyprland.bind("workspaces")
        .as(ws => ws.filter(({ id }) => {
            if (monitor === 1) {
                return id >= 1 && id <= 10
            } else if (monitor === 0) {
                return id >= 11 && id <= 20
            }
        }).map(({ id }) => Widget.Button({
            on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
            child: Widget.Label(`${id}`),
            class_name: activeId.as(i => `${i === id ? "focused" : ""}`),
        })))

    return Widget.Box({
        cla…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Aylur
Comment options

@kotontrion
Comment options

@nonetrix
Comment options

Answer selected by nonetrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants