Skip to content

Commit

Permalink
pass [!] responses to stderr instead of stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixKratz committed Dec 27, 2022
1 parent e489d47 commit 7d78837
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sketchybar.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ static int client_send_message(int argc, char **argv) {
free(message);
if (!rsp) return EXIT_SUCCESS;

printf("%s", rsp);
if (strlen(rsp) > 2 && rsp[1] == '!') {
fprintf(stderr, "%s", rsp);
return EXIT_FAILURE;
} else {
fprintf(stdout, "%s", rsp);
}

if (strlen(rsp) > 2 && rsp[1] == '!') return EXIT_FAILURE;
return EXIT_SUCCESS;
}

Expand Down

0 comments on commit 7d78837

Please sign in to comment.