From 9b39a0c2e0fb3ad4500c132dc975580f90eb1c08 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 10 Aug 2022 21:22:11 +0200 Subject: Added hyprctl setcursor --- hyprctl/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'hyprctl/main.cpp') 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); -- cgit v1.2.3