diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-05 18:04:44 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-05 18:04:44 +0000 |
| commit | 5a750b485aca8b2fd5545cfe86b3a48c69355d65 (patch) | |
| tree | b5624dc630450152a52889968805e2f7faee0c40 /hyprctl/main.cpp | |
| parent | a71f44baa521e2fb867db8536d7766e7d02f3e32 (diff) | |
Added creating / destroying outputs on a multi-backend + headless backend
See `hyprctl output`.
Diffstat (limited to 'hyprctl/main.cpp')
| -rw-r--r-- | hyprctl/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index f4de085f..edae83e1 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -217,6 +217,21 @@ int setcursorRequest(int argc, char** argv) { return 0; } +int outputRequest(int argc, char** argv) { + if (argc < 4) { + std::cout << "Usage: hyprctl output <mode> <name>\n\ + creates / destroys a fake output\n\ + with create, name is the backend name to use (available: auto, x11, wayland, headless)\n\ + with destroy, name is the output name to destroy"; + return 1; + } + + std::string rq = "output " + std::string(argv[2]) + " " + std::string(argv[3]); + + request(rq); + return 0; +} + void batchRequest(std::string arg) { std::string rq = "[[BATCH]]" + arg.substr(arg.find_first_of(" ") + 1); @@ -290,6 +305,7 @@ int main(int argc, char** argv) { else if (fullRequest.contains("/reload")) request(fullRequest); else if (fullRequest.contains("/getoption")) request(fullRequest); else if (fullRequest.contains("/cursorpos")) request(fullRequest); + else if (fullRequest.contains("/output")) exitStatus = outputRequest(argc, argv); else if (fullRequest.contains("/setcursor")) exitStatus = setcursorRequest(argc, argv); else if (fullRequest.contains("/dispatch")) exitStatus = dispatchRequest(argc, argv); else if (fullRequest.contains("/keyword")) exitStatus = keywordRequest(argc, argv); |
