Is your feature request related to a problem? Please describe.
Currently, niri.vala does not initialize its state when a Niri instance is created. As a result, properties such as workspaces, windows, outputs, and focused objects remain empty until IPC events are received.
This makes it difficult to access the current state immediately after calling Niri.get_default().
Describe the solution you'd like
Add an initialization step similar to AstalHyprland, where Niri performs an initial IPC sync and populates its fields before the instance is exposed.
This would allow consumers to access a fully populated state right after initialization.
Describe alternatives you've considered
The current workaround is to wait for events or perform IPC queries manually, which duplicates logic already handled by the library.
Additional context
AstalHyprland already implements this behavior:
hyprland.vala
Implementing something similar in AstalNiri would provide a more consistent and predictable API.
Is your feature request related to a problem? Please describe.
Currently,
niri.valadoes not initialize its state when aNiriinstance is created. As a result, properties such as workspaces, windows, outputs, and focused objects remain empty until IPC events are received.This makes it difficult to access the current state immediately after calling
Niri.get_default().Describe the solution you'd like
Add an initialization step similar to AstalHyprland, where
Niriperforms an initial IPC sync and populates its fields before the instance is exposed.This would allow consumers to access a fully populated state right after initialization.
Describe alternatives you've considered
The current workaround is to wait for events or perform IPC queries manually, which duplicates logic already handled by the library.
Additional context
AstalHyprland already implements this behavior:
hyprland.vala
Implementing something similar in AstalNiri would provide a more consistent and predictable API.