-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #408 from jcinis/master
dunst: notification muting moved to new dunstctl command
- Loading branch information
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|