Add complete.oga as backup sound

This commit is contained in:
Jeena 2025-06-09 10:49:19 +09:00
parent e26ffa98b7
commit b0582b7781
2 changed files with 17 additions and 2 deletions

View file

@ -35,5 +35,20 @@ def notify_done(title, body):
def play_complete_sound(): def play_complete_sound():
if shutil.which("canberra-gtk-play"): if shutil.which("canberra-gtk-play"):
subprocess.Popen(["canberra-gtk-play", "--id", "complete"]) subprocess.Popen(["canberra-gtk-play", "--id", "complete"])
else: return
print("canberra-gtk-play not found.")
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

BIN
src/resources/complete.oga Normal file

Binary file not shown.