diff --git a/README.md b/README.md index 99fee6b..23b37dd 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/thiagokokada/hyprland-go.svg)](https://pkg.go.dev/github.com/thiagokokada/hyprland-go) [![Go](https://github.com/thiagokokada/hyprland-go/actions/workflows/go.yml/badge.svg)](https://github.com/thiagokokada/hyprland-go/actions/workflows/go.yml) [![Test](https://github.com/thiagokokada/hyprland-go/actions/workflows/nix.yaml/badge.svg)](https://github.com/thiagokokada/hyprland-go/actions/workflows/nix.yaml) -[![Hyprland](https://img.shields.io/badge/Hyprland-0.41.2-blue)](https://github.com/hyprwm/Hyprland) +[![Hyprland](https://img.shields.io/badge/Hyprland-0.42-blue)](https://github.com/hyprwm/Hyprland) [![stability-alpha](https://img.shields.io/badge/stability-alpha-f4d03f.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#alpha) An unofficial Go wrapper for Hyprland's IPC. diff --git a/flake.lock b/flake.lock index 5e97fc2..55ad208 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1721562059, - "narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=", + "lastModified": 1724819573, + "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe", + "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6f65c64..b17cafb 100644 --- a/flake.nix +++ b/flake.nix @@ -94,6 +94,8 @@ glxinfo -B > ${glxinfoOut} || true cd ${./.} + + export CI=1 go test -bench=. -coverprofile ${covOut} -v > ${testLog} 2>&1 go tool cover -html=${covOut} -o ${covHtml} ''; diff --git a/request_test.go b/request_test.go index ffb4a81..a713b9e 100644 --- a/request_test.go +++ b/request_test.go @@ -241,6 +241,11 @@ func TestConfigErrors(t *testing.T) { } func TestCursorPos(t *testing.T) { + if os.Getenv("CI") != "" { + // https://github.com/NixOS/nixpkgs/issues/156067 + // https://github.com/hyprwm/Hyprland/discussions/1257 + t.Skip("skip test that always returns CursorPos{X:0, Y:0} in CI since we can't move cursor") + } testCommand(t, c.CursorPos, CursorPos{}) } diff --git a/request_types.go b/request_types.go index ac099f3..a5a4001 100644 --- a/request_types.go +++ b/request_types.go @@ -3,7 +3,7 @@ package hyprland import "net" // Indicates the version where the structs are up-to-date. -const HYPRLAND_VERSION = "0.41.2" +const HYPRLAND_VERSION = "0.42" // Represents a raw request that is passed for Hyprland's socket. type RawRequest []byte @@ -58,29 +58,38 @@ type Bind struct { Arg string `json:"arg"` } +type FullscreenState int + +const ( + None FullscreenState = iota + Maximized + Fullscreen + MaximizedFullscreen +) + type Client struct { - Address string `json:"address"` - Mapped bool `json:"mapped"` - Hidden bool `json:"hidden"` - At []int `json:"at"` - Size []int `json:"size"` - Workspace WorkspaceType `json:"workspace"` - Floating bool `json:"floating"` - Pseudo bool `json:"pseudo"` - Monitor int `json:"monitor"` - Class string `json:"class"` - Title string `json:"title"` - InitialClass string `json:"initialClass"` - InitialTitle string `json:"initialTitle"` - Pid int `json:"pid"` - Xwayland bool `json:"xwayland"` - Pinned bool `json:"pinned"` - Fullscreen bool `json:"fullscreen"` - FullscreenMode int `json:"fullscreenMode"` - Grouped []string `json:"grouped"` - Tags []string `json:"tags"` - Swallowing string `json:"swallowing"` - FocusHistoryId int `json:"focusHistoryID"` + Address string `json:"address"` + Mapped bool `json:"mapped"` + Hidden bool `json:"hidden"` + At []int `json:"at"` + Size []int `json:"size"` + Workspace WorkspaceType `json:"workspace"` + Floating bool `json:"floating"` + Pseudo bool `json:"pseudo"` + Monitor int `json:"monitor"` + Class string `json:"class"` + Title string `json:"title"` + InitialClass string `json:"initialClass"` + InitialTitle string `json:"initialTitle"` + Pid int `json:"pid"` + Xwayland bool `json:"xwayland"` + Pinned bool `json:"pinned"` + Fullscreen FullscreenState `json:"fullscreen"` + FullscreenClient FullscreenState `json:"fullscreenClient"` + Grouped []string `json:"grouped"` + Tags []string `json:"tags"` + Swallowing string `json:"swallowing"` + FocusHistoryId int `json:"focusHistoryID"` } type ConfigError string