diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-08-10 21:22:11 +0200 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-08-10 21:22:11 +0200 |
| commit | 9b39a0c2e0fb3ad4500c132dc975580f90eb1c08 (patch) | |
| tree | 559cd28307542ec184bfc522131457bcdc79f22d /hyprctl/main.cpp | |
| parent | f64f94ca565a2ec9f174f57a20fcfbfddb762cb8 (diff) | |
Added hyprctl setcursor
Diffstat (limited to 'hyprctl/main.cpp')
| -rw-r--r-- | hyprctl/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 9abf67a3..a282b5d0 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -34,6 +34,7 @@ commands: splash hyprpaper reload + setcursor flags: -j -> output in JSON @@ -183,6 +184,17 @@ void hyprpaperRequest(int argc, char** argv) { requestHyprpaper(rq); } +void setcursorRequest(int argc, char** argv) { + if (argc < 4) { + std::cout << "setcursor requires 2 params"; + return; + } + + std::string rq = "setcursor " + std::string(argv[2]) + " " + std::string(argv[3]); + + request(rq); +} + void batchRequest(std::string arg) { std::string rq = "[[BATCH]]" + arg.substr(arg.find_first_of(" ") + 1); @@ -252,6 +264,7 @@ int main(int argc, char** argv) { else if (fullRequest.contains("/splash")) request(fullRequest); else if (fullRequest.contains("/devices")) request(fullRequest); else if (fullRequest.contains("/reload")) request(fullRequest); + else if (fullRequest.contains("/setcursor")) setcursorRequest(argc, argv); else if (fullRequest.contains("/dispatch")) dispatchRequest(argc, argv); else if (fullRequest.contains("/keyword")) keywordRequest(argc, argv); else if (fullRequest.contains("/hyprpaper")) hyprpaperRequest(argc, argv); |
