Skip to content

Commit

Permalink
Merge pull request #408 from jcinis/master
Browse files Browse the repository at this point in the history
dunst: notification muting moved to new dunstctl command
  • Loading branch information
denisse-dev authored Jun 3, 2021
2 parents 30281f6 + db2ef7b commit 22d4487
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dunst/dunst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ track of the toggle.
__author__ = "Jessey White-Cinis <[email protected]>"
__copyright__ = "Copyright (c) 2019 Jessey White-Cinis"
__license__ = "MIT"
__version__ = "1.0.0"
__version__ = "1.1.0"

import os
import subprocess
Expand Down Expand Up @@ -39,8 +39,10 @@ def clicked():

def muted():
'''Returns True if Dunst is muted'''
mute = "DUNST_MUTE" in os.environ and os.environ["DUNST_MUTE"]
return mute == 'on'
cmd = ['dunstctl', 'is-paused']
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
output = proc.communicate()[0]
return u'true' == output.strip().decode("UTF-8")

if clicked():
# toggle button click to turn mute on and off
Expand Down

0 comments on commit 22d4487

Please sign in to comment.