Skip to content

Commit

Permalink
Merge pull request #14 from thiagokokada/hyprland-042
Browse files Browse the repository at this point in the history
Support hyprland 0.42
  • Loading branch information
thiagokokada authored Aug 29, 2024
2 parents b8b476d + 9ff3608 commit e3656b9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}
'';
Expand Down
5 changes: 5 additions & 0 deletions request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
}

Expand Down
55 changes: 32 additions & 23 deletions request_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e3656b9

Please sign in to comment.