hyprctl: add delimiter to hyprctl batch command (#6261)

adds a delimiter of 3 newlines to separate different command outputs
This commit is contained in:
Flafy 2024-05-27 23:31:35 +03:00 committed by GitHub
parent db5d39a66f
commit 546a486bab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {