You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you look at the last few lines, you'll see that 5 adhan times have been scheduled. Then there is another line at the end which makes sure that at 1am every day the same script will run and calculate adhan times for that day. And lastly, there is a line to clear logs on a monthly basis so that your log file doesn't grow too big.
@@ -81,11 +102,47 @@ There are 2 additional arguments that are optional, you can set them in the firs
81
102
further runs: `--fajr-azaan-volume` and `azaan-volume`. You can control the volume of the Azaan
82
103
by supplying numbers in millibels. To get more information on how to select the values, run the command with `-h`.
83
104
105
+
## Configuring custom actions before/after adhan
106
+
107
+
Sometimes it is needed to run custom commands either before, after or before
108
+
and after playing adhan. For example, if you have
109
+
[Quran playing continuously](https://github.com/LintangWisesa/RPi_QuranSpeaker),
110
+
you would want to pause and resume the playback. Another example, is to set your
111
+
status on a social network, or a calendar, to block/unblock the Internet
112
+
using [pi.hole rules](https://docs.pi-hole.net/), ... etc.
113
+
114
+
You can easily do this by adding scripts in the following directories:
115
+
-`before-hooks.d`: Scripts to run before adhan playback
116
+
-`after-hooks.d`: Scripts to run after adhan playback
117
+
118
+
### Example:
119
+
To pause/resume Quran playback if using the
120
+
[RPi_QuranSpeaker](https://github.com/LintangWisesa/RPi_QuranSpeaker) project, place
121
+
the following in 2 new files under the above 2 directories:
1. You can see your currently scheduled jobs by running `crontab -l`
86
143
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`
87
144
88
-
###Credits
145
+
## Credits
89
146
I have made modifications / bug fixes but I've used the following as starting point:
90
147
* Python code to calculate adhan times: http://praytimes.org/code/
91
148
* 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