Merge pull request #535 from Saeissl/master

Add a toggle command
This commit is contained in:
Nikos Tsipinakis 2018-08-11 18:43:09 +03:00 committed by GitHub
commit a749847040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -719,7 +719,8 @@ Example time: "1000ms" "10m"
=head1 MISCELLANEOUS
Dunst can be paused by sending a notification with a summary of
"DUNST_COMMAND_PAUSE" and resumed with a summary of "DUNST_COMMAND_RESUME".
"DUNST_COMMAND_PAUSE", resumed with a summary of "DUNST_COMMAND_RESUME" and
toggled with a summary of "DUNST_COMMAND_TOGGLE".
Alternatively you can send SIGUSR1 and SIGUSR2 to pause and unpause
respectively. For Example:

View File

@ -95,6 +95,10 @@ int queues_notification_insert(notification *n)
pause_displayed = false;
return 0;
}
if (strcmp("DUNST_COMMAND_TOGGLE", n->summary) == 0) {
pause_displayed = !pause_displayed;
return 0;
}
if (n->id == 0) {
n->id = ++next_notification_id;