diff --git a/safeeyes/Utility.py b/safeeyes/Utility.py index ddbb3da..e57edfb 100644 --- a/safeeyes/Utility.py +++ b/safeeyes/Utility.py @@ -47,13 +47,14 @@ def play_notification(): # Write file data into the sound stream data = sound.readframes(CHUNK) - while data != '': + while data != b'': stream.write(data) data = sound.readframes(CHUNK) # Close steam stream.stop_stream() stream.close() + sound.close() wrapper.terminate() except Exception as e: @@ -100,7 +101,7 @@ def is_active_window_skipped(skip_break_window_classes, take_break_window_classe cmdlist = ['xprop', '-root', '-notype','-id',active_xid, 'WM_CLASS', '_NET_WM_STATE'] try: - stdout = subprocess.check_output(cmdlist) + stdout = subprocess.check_output(cmdlist).decode('utf-8') except subprocess.CalledProcessError: logging.warning("Error in finding full-screen application") pass diff --git a/safeeyes/resource/alert.wav b/safeeyes/resource/alert.wav index ec0f946..48be2e0 100644 Binary files a/safeeyes/resource/alert.wav and b/safeeyes/resource/alert.wav differ diff --git a/safeeyes/safeeyes.py b/safeeyes/safeeyes.py index 9d071c9..a8726c1 100755 --- a/safeeyes/safeeyes.py +++ b/safeeyes/safeeyes.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Safe Eyes is a utility to remind you to take break frequently # to protect your eyes from eye strain. @@ -244,7 +244,7 @@ def running(): ''' process_count = 0 for proc in psutil.process_iter(): - try: + try: # Check if safeeyes is in process arguments cmd_line = proc.cmdline() if 'python2' == cmd_line[0] and 'safeeyes' in cmd_line[1]: