Skip to content

Commit

Permalink
do_not_disturb: simplify dunst logic (#1654)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximbaz authored and lasers committed Jan 16, 2019
1 parent d8d5208 commit 70be5bd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions py3status/modules/do_not_disturb.py
Expand Up @@ -91,13 +91,15 @@ class Dunst(Notification):

def toggle(self, state):
if state:
self.parent.py3.command_run("pkill -SIGUSR1 dunst") # pause
# pause
self.parent.py3.command_run("pkill -SIGUSR1 dunst")
else:
if not self.parent.pause:
# if not in pause mode we delete all pending notifications in
# the queue before resuming
if self.parent.pause:
# resume
self.parent.py3.command_run("pkill -SIGUSR2 dunst")
else:
# delete all pending notifications and resume
self.parent.py3.command_run("pkill -SIGTERM dunst")
self.parent.py3.command_run("pkill -SIGUSR2 dunst") # resume


class Xfce4_notifyd(Notification):
Expand Down

0 comments on commit 70be5bd

Please sign in to comment.