From 6b33b67e5bff252b54a93d6387a2fe03a2b13c4b Mon Sep 17 00:00:00 2001 From: "M. A. Reza" Date: Wed, 25 Feb 2026 11:52:47 +0330 Subject: [PATCH] update --- .vscode/launch.json | 16 ++++++++++++++++ utils/sound_utils.py | 19 +++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..dfc4ae8 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + { + "name": "Python Debugger: Current File", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal" + } + ] +} \ No newline at end of file diff --git a/utils/sound_utils.py b/utils/sound_utils.py index f4cb57a..28a7b87 100644 --- a/utils/sound_utils.py +++ b/utils/sound_utils.py @@ -3,9 +3,10 @@ import subprocess SOUNDS = { "alarm": { "file_path": "/usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga", - "volume": "50%", + "volume": "35%", }, - "notif": {"file_path": "utils/assets/error-08-206492.mp3", "volume": "85%"}, + "notif": {"file_path": "utils/assets/error-08-206492.mp3", "volume": "45%"}, + "success": {"file_path": "/usr/share/sounds/freedesktop/stereo/message.oga", "volume": "40%"} } @@ -22,3 +23,17 @@ def play_alarm_sound(file_path, volume): capture_output=True, ) subprocess.run(["paplay", file_path], capture_output=True) + +if __name__ == '__main__': + import subprocess + from datetime import datetime, time + now = datetime.now().time() + namaz_zohr_time = time(12, 9) < now < time(13, 20) + namaz_maghrib_time = time(17, 24) < now < time(18, 45) + if not namaz_zohr_time and not namaz_maghrib_time: + print("*** PLAYED ALARM SOUND ***") + play_alarm_sound(**SOUNDS["success"]) + do_alarm_later = False + else: + print("*** It's namaz time so we'll play alarm sound later") + do_alarm_later = True