Refactor pomodoro
module
Replace `subprocess` call with built-in module for sending desktop notifications.
This commit is contained in:
parent
1d1491c6a3
commit
4f7d5673c0
@ -1,6 +1,7 @@
|
||||
import subprocess
|
||||
from datetime import datetime, timedelta
|
||||
from i3pystatus import IntervalModule
|
||||
from i3pystatus.core.desktop import DesktopNotification
|
||||
|
||||
|
||||
STOPPED = 0
|
||||
@ -100,9 +101,9 @@ class Pomodoro(IntervalModule):
|
||||
self.time = None
|
||||
|
||||
def _alarm(self, text):
|
||||
subprocess.call(['notify-send',
|
||||
'Alarm!',
|
||||
text])
|
||||
notification = DesktopNotification('Alarm!', text)
|
||||
notification.display()
|
||||
|
||||
subprocess.Popen(['aplay',
|
||||
self.sound,
|
||||
'-q'],
|
||||
|
Loading…
Reference in New Issue
Block a user