diff options
| author | Flafy <flafyarazi@gmail.com> | 2024-05-27 23:31:35 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-27 22:31:35 +0200 |
| commit | 546a486bab56af06fd95b23fb2ce231d00f671c9 (patch) | |
| tree | 510d8a3a5a5fc0ddd21b3b7b7fe99a07690717cd /src/debug/HyprCtl.cpp | |
| parent | db5d39a66f1285f78321d953eac398feaedfc63d (diff) | |
hyprctl: add delimiter to hyprctl batch command (#6261)
adds a delimiter of 3 newlines to separate different command outputs
Diffstat (limited to 'src/debug/HyprCtl.cpp')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 1faea41c..795272cc 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -1045,13 +1045,15 @@ std::string dispatchBatch(eHyprCtlOutputFormat format, std::string request) { nextItem(); + const std::string DELIMITER = "\n\n\n"; + while (curitem != "" || request != "") { - reply += g_pHyprCtl->getReply(curitem); + reply += g_pHyprCtl->getReply(curitem) + DELIMITER; nextItem(); } - return reply; + return reply.substr(0, std::max(static_cast<int>(reply.size() - DELIMITER.size()), 0)); } std::string dispatchSetCursor(eHyprCtlOutputFormat format, std::string request) { |
