Merge pull request #494 from rampage644/features/pomodoro
Refactor `pomodoro` module
This commit is contained in:
commit
83ee2249de
@ -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'],
|
||||||
|
Loading…
Reference in New Issue
Block a user