added WindowLayout to Window structure introduced in Niri version 25.08
This commit is contained in:
2
go.mod
2
go.mod
@ -1,6 +1,6 @@
|
|||||||
module git.tordarus.net/niri-tools/niri
|
module git.tordarus.net/niri-tools/niri
|
||||||
|
|
||||||
go 1.24.4
|
go 1.25
|
||||||
|
|
||||||
require (
|
require (
|
||||||
git.tordarus.net/tordarus/channel v0.1.20
|
git.tordarus.net/tordarus/channel v0.1.20
|
||||||
|
@ -5,14 +5,15 @@ import "encoding/json"
|
|||||||
type WindowID int
|
type WindowID int
|
||||||
|
|
||||||
type Window struct {
|
type Window struct {
|
||||||
ID WindowID `json:"id"`
|
ID WindowID `json:"id"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
AppID string `json:"app_id"`
|
AppID string `json:"app_id"`
|
||||||
PID int `json:"pid"`
|
PID int `json:"pid"`
|
||||||
WorkspaceID WorkspaceID `json:"workspace_id"`
|
WorkspaceID WorkspaceID `json:"workspace_id"`
|
||||||
Urgent bool `json:"is_urgent"`
|
Urgent bool `json:"is_urgent"`
|
||||||
Floating bool `json:"is_floating"`
|
Floating bool `json:"is_floating"`
|
||||||
Focused bool `json:"is_focused"`
|
Focused bool `json:"is_focused"`
|
||||||
|
Layout WindowLayout `json:"layout"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m Window) String() string {
|
func (m Window) String() string {
|
||||||
|
16
model_window_layout.go
Normal file
16
model_window_layout.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package niri
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
|
type WindowLayout struct {
|
||||||
|
PosInScrollingLayout Option[[2]int] `json:"pos_in_scrolling_layout"`
|
||||||
|
TileSize [2]float64 `json:"tile_size"`
|
||||||
|
WindowSize [2]int `json:"window_size"`
|
||||||
|
TilePosInWorkspaceView Option[[2]float64] `json:"tile_pos_in_workspace_view"`
|
||||||
|
WindowOffsetInTile [2]float64 `json:"window_offset_in_tile"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m WindowLayout) String() string {
|
||||||
|
data, _ := json.MarshalIndent(m, "", "\t")
|
||||||
|
return string(data)
|
||||||
|
}
|
Reference in New Issue
Block a user