Merge pull request #494 from rampage644/features/pomodoro

Refactor `pomodoro` module
This commit is contained in:
enkore 2017-01-11 12:39:09 +01:00 committed by GitHub
commit 83ee2249de

View File

@ -1,6 +1,7 @@
import subprocess import subprocess
from datetime import datetime, timedelta from datetime import datetime, timedelta
from i3pystatus import IntervalModule from i3pystatus import IntervalModule
from i3pystatus.core.desktop import DesktopNotification
STOPPED = 0 STOPPED = 0
@ -100,9 +101,9 @@ class Pomodoro(IntervalModule):
self.time = None self.time = None
def _alarm(self, text): def _alarm(self, text):
subprocess.call(['notify-send', notification = DesktopNotification('Alarm!', text)
'Alarm!', notification.display()
text])
subprocess.Popen(['aplay', subprocess.Popen(['aplay',
self.sound, self.sound,
'-q'], '-q'],