Skip to content

Commit 22d4487

Browse files
authored
Merge pull request #408 from jcinis/master
dunst: notification muting moved to new dunstctl command
2 parents 30281f6 + db2ef7b commit 22d4487

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dunst/dunst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ track of the toggle.
1010
__author__ = "Jessey White-Cinis <[email protected]>"
1111
__copyright__ = "Copyright (c) 2019 Jessey White-Cinis"
1212
__license__ = "MIT"
13-
__version__ = "1.0.0"
13+
__version__ = "1.1.0"
1414

1515
import os
1616
import subprocess
@@ -39,8 +39,10 @@ def clicked():
3939

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

4547
if clicked():
4648
# toggle button click to turn mute on and off

0 commit comments

Comments
 (0)