Skip to content

[screen-toolkit][FEATURE] Support "Annotate Window" on Niri #402

Description

@the-simen

Submission checklist

  • I have searched existing issues and confirmed this has not been requested before.
  • I have checked existing pull requests for similar changes.
  • This is about a community plugin, not about Noctalia itself (those belong in the noctalia repo).

Plugin

screen-toolkit

Feature type

Integration support

Feature summary

The Window tool in Screen Toolkit does not work when running Noctalia with Niri.

All other Screen Toolkit features I have tested work correctly on Niri, including screen recording and markup/annotation. The issue appears to be specific to the Window annotation/capture action.

From the current implementation, annotateWindow() appears to be restricted to Hyprland, and the capture script uses hyprctl activewindow -j to obtain the active window geometry.

For example, the current logic is effectively:

function annotateWindow() {
    if (root.isHyprland)
        root.runAnnotateActiveWindow()
}

and the capture script relies on:

hyprctl activewindow -j

As a result, on Niri the Window action does nothing.

Expected behavior

The Window action should capture the currently focused Niri window and open it in the Screen Toolkit annotation/markup interface, just like it does on Hyprland.

Motivation / use case

Doesn't work on niri

Proposed solution

Niri provides IPC for window information:

niri msg -j windows

The focused window can be identified from the returned JSON and its geometry could potentially be used to construct the capture region.

Alternatively, Niri itself provides:

niri msg action screenshot-window

which can capture the currently focused window.

It would be great if Annotate Window could support Niri using one of these approaches.

Alternatives considered

No response

References / related projects

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions