@@ -19,7 +19,7 @@ This projects uses a python script which automatically calculates [adhan](https:
19
19
Run this command:
20
20
21
21
``` bash
22
- $ python /home/pi/adhan/updateAzaanTimers.py --lat < YOUR_LAT> --lng < YOUR_LNG> --method < METHOD>
22
+ $ /home/pi/adhan/updateAzaanTimers.py --lat < YOUR_LAT> --lng < YOUR_LNG> --method < METHOD>
23
23
```
24
24
25
25
Replace the arguments above with your location information and calculation method:
@@ -34,12 +34,12 @@ If everythig worked, your output will look something like this:
34
34
14:11
35
35
16:30
36
36
17:53
37
- 51 5 * * * omxplayer -o local /home/pi/adhan/Adhan-fajr.mp3 > /dev/null 2>&1 # rpiAdhanClockJob
38
- 52 11 * * * omxplayer -o local /home/pi/adhan/Adhan-Makkah .mp3 > /dev/null 2>&1 # rpiAdhanClockJob
39
- 11 14 * * * omxplayer -o local /home/pi/adhan/Adhan-Makkah .mp3 > /dev/null 2>&1 # rpiAdhanClockJob
40
- 30 16 * * * omxplayer -o local /home/pi/adhan/Adhan-Makkah .mp3 > /dev/null 2>&1 # rpiAdhanClockJob
41
- 53 17 * * * omxplayer -o local /home/pi/adhan/Adhan-Makkah .mp3 > /dev/null 2>&1 # rpiAdhanClockJob
42
- 0 1 * * * python /home/pi/adhan/updateAzaanTimers.py >> /home/pi/adhan/adhan.log 2>&1 # rpiAdhanClockJob
37
+ 51 5 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-fajr.mp3 0 # rpiAdhanClockJob
38
+ 52 11 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-Madinah .mp3 0 # rpiAdhanClockJob
39
+ 11 14 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-Madinah .mp3 0 # rpiAdhanClockJob
40
+ 30 16 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-Madinah .mp3 0 # rpiAdhanClockJob
41
+ 53 17 * * * /home/pi/adhan/playAzaan.sh /home/pi/adhan/Adhan-Madinah .mp3 0 # rpiAdhanClockJob
42
+ 0 1 * * * /home/pi/adhan/updateAzaanTimers.py >> /home/pi/adhan/adhan.log 2>&1 # rpiAdhanClockJob
43
43
@monthly truncate -s 0 /home/pi/adhan/adhan.log 2>&1 # rpiAdhanClockJob
44
44
Script execution finished at: 2017-01-06 21:22:31.512667
45
45
```
@@ -56,11 +56,47 @@ There are 2 additional arguments that are optional, you can set them in the firs
56
56
further runs: ` --fajr-azaan-volume ` and ` azaan-volume ` . You can control the volume of the Azaan
57
57
by supplying numbers in millibels. To get more information on how to select the values, run the command with ` -h ` .
58
58
59
+ ## Configuring custom actions before/after adhan
60
+
61
+ Sometimes it is needed to run custom commands either before, after or before
62
+ and after playing adhan. For example, if you have
63
+ [ Quran playing continuously] ( https://github.com/LintangWisesa/RPi_QuranSpeaker ) ,
64
+ you would want to pause and resume the playback. Another example, is to set your
65
+ status on a social network, or a calendar, to block/unblock the Internet
66
+ using [ pi.hole rules] ( https://docs.pi-hole.net/ ) , ... etc.
67
+
68
+ You can easily do this by adding scripts in the following directories:
69
+ - ` before-hooks.d ` : Scripts to run before adhan playback
70
+ - ` after-hooks.d ` : Scripts to run after adhan playback
71
+
72
+ ### Example:
73
+ To pause/resume Quran playback if using the
74
+ [ RPi_QuranSpeaker] ( https://github.com/LintangWisesa/RPi_QuranSpeaker ) project, place
75
+ the following in 2 new files under the above 2 directories:
76
+
77
+ ``` bash
78
+ # before-hooks.d/01-pause-quran-speaker.sh
79
+ #! /usr/bin/env bash
80
+ /home/pi/RPi_QuranSpeaker/pauser.py pause
81
+ ```
82
+
83
+ ``` bash
84
+ # after-hooks.d/01-resume-quran-speaker.sh
85
+ #! /usr/bin/env bash
86
+ /home/pi/RPi_QuranSpeaker/pauser.py resume
87
+ ```
88
+
89
+ Do not forget to make the scripts executable:
90
+ ``` bash
91
+ chmod u+x ./before-hooks.d/01-pause-quran-speaker.sh
92
+ chmod u+x ./after-hooks.d/01-resume-quran-speaker.sh
93
+ ```
94
+
59
95
## Tips:
60
96
1 . You can see your currently scheduled jobs by running ` crontab -l `
61
97
2 . The output of the job that runs at 1am every night is being captured in ` /home/pi/adhan/adhan.log ` . This way you can keep track of all successful runs and any potential issues. This file will be truncated at midnight on the forst day of each month. To view the output type ` $ cat /home/pi/adhan/adhan.log `
62
98
63
- ### Credits
99
+ ## Credits
64
100
I have made modifications / bug fixes but I've used the following as starting point:
65
101
* Python code to calculate adhan times: http://praytimes.org/code/
66
102
* Basic code to turn the above into an adhan clock: http://randomconsultant.blogspot.co.uk/2013/07/turn-your-raspberry-pi-into-azaanprayer.html
0 commit comments