Merge pull request #110 from tokyovigilante/ipc-fix

Update to new Sway IPC protocol
This commit is contained in:
Alex 2018-11-29 00:40:57 +01:00 committed by GitHub
commit 37c7e586d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ struct waybar::modules::sway::Ipc::ipc_response
void waybar::modules::sway::Ipc::subscribe(const std::string& payload) const
{
auto res = send(fd_event_, IPC_SUBSCRIBE, payload);
if (res.payload != "{\"success\": true}") {
if (res.payload != "{\"success\": true}" && res.payload != "[{\"success\": true}]") {
throw std::runtime_error("Unable to subscribe ipc event");
}
}
@ -131,4 +131,4 @@ struct waybar::modules::sway::Ipc::ipc_response
waybar::modules::sway::Ipc::handleEvent() const
{
return recv(fd_event_);
}
}