Don't unnecessarily call alarm when duration is zero

This commit is contained in:
Samuel Dudik 2020-08-13 17:37:40 +02:00
parent e43bdb67a6
commit 30b0961b2e
4 changed files with 10 additions and 3 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
herbe
.ccls-cache

4
TODO.md Normal file
View file

@ -0,0 +1,4 @@
* Handle multiple notifications at the same time
* Properly handle duration = 0
* Keyboard shortcut to dismiss and accept notifications (also mouse)
* Properly print new lines

View file

@ -67,7 +67,9 @@ int main(int argc, char *argv[])
die("Usage: %s body", argv[0]);
signal(SIGALRM, expire);
alarm(duration);
if (duration != 0)
alarm(duration);
display = XOpenDisplay(0);