diff --git a/src/recoder/utils.py b/src/recoder/utils.py index 86ece2f..8c20280 100644 --- a/src/recoder/utils.py +++ b/src/recoder/utils.py @@ -35,5 +35,20 @@ def notify_done(title, body): def play_complete_sound(): if shutil.which("canberra-gtk-play"): subprocess.Popen(["canberra-gtk-play", "--id", "complete"]) - else: - print("canberra-gtk-play not found.") + return + + sound_paths = [ + os.path.expanduser("~/.local/share/sounds/recoder/complete.oga"), + "/usr/share/sounds/freedesktop/stereo/complete.oga", + "/usr/share/sounds/recoder/complete.oga", + "/app/share/sounds/complete.oga", + ] + + players = ["paplay", "play"] + + for player in players: + if shutil.which(player): + for path in sound_paths: + if os.path.isfile(path) and os.access(path, os.R_OK): + subprocess.Popen([player, path]) + return \ No newline at end of file diff --git a/src/resources/complete.oga b/src/resources/complete.oga new file mode 100644 index 0000000..7d34954 Binary files /dev/null and b/src/resources/complete.oga differ