Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: make 'j/' prefix for requests optional #33

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

thiagokokada
Copy link
Owner

Not every command supports JSON response (e.g.: Dispatch), and forcing it in every command not only send an unnecessary request to Hyprland IPC, but also can make it more fragile since if a future Hyprland version implement JSON response for an existing command, this command will break.

This commit adds a explicit jsonResp parameter to prepareRequests() so we can differentiate between commands that return JSON response for those that doesn't, and we will only prefix the request with 'j/' if jsonResp == true.

Not every command supports JSON response (e.g.: Dispatch), and forcing
it in every command not only send an unnecessary request to Hyprland
IPC, but also can make it more fragile since if a future Hyprland
version implement JSON response for an existing command, this command
will break.

This commit adds a explicit `jsonResp` parameter to `prepareRequests()`
so we can differentiate between commands that return JSON response for
those that doesn't, and we will only prefix the request with 'j/' if
`jsonResp == true`.
@thiagokokada thiagokokada merged commit 768532f into main Sep 4, 2024
2 checks passed
@thiagokokada thiagokokada deleted the json-resp-optional branch September 4, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant