salahtime is a small command line application written in C for Linux and BSD that displays the Islamic prayer times for any city (America/Ottawa by default).
It uses a multidimensional array to store the time table and the table can easily be substituted for another if needed.
Create a file named in the format: cities/{region}_{city}_{cc}.c
If you want to contribute to the project you can copy that file into the "cities" folder and then make a pull request to add the city to the main repository, but make sure that the format matches.
Clone this repository.
$ git clone https://github.com/hghann/salahtimepp
$ cd salahtimepp
The Makefile uses clang, but if you want to use gcc instead just change
the CC variable to gcc.
$ make CC=gcc
The default city in the Makefile is America/Ottawa, you can overwrite
that with the MY_CITY variable, in this example we overwrite it with
Europe/Berlin.
$ make MY_CITY=cities/america_windsor.c
The Hijri calendar and next prayer countdown are considered "extra" features.
To compile the binary with said features, you simply set the FEATURE_HIJRI_VAL
and/or FEATURE_NEXT_VAL to 1.
$ make FEATURE_HIJRI_VAL=1 FEATURE_NEXT_VAL=1
Then simply copy the salahtime executable to somewhere in your home directory
and add that directory to your $PATH variable.
The following example uses the Bash shell.
$ mkdir $HOME/bin
$ cp -f salahtime $HOME/bin/
Edit .bashrc in your home directory with your favorite text editor and add
the "bin" folder to your $PATH variable.
export PATH=$HOME/bin:$PATH
Remember to reload bash.
$ exec bash
And if you need to uninstall salahtime just remove it from the "bin" folder.
If, however, you want to, you can also install this system-wide (requires root).
$ make CC=gcc
$ sudo mkdir -p /usr/local/bin
$ sudo cp -f ./salahtime /usr/local/bin/
See the man page for usage information. For an ad-hoc way of reading the manpage, inside the main directory of salahtime:
$ man ./salahtime.1
To get the manpage of salahtime from anywhere:
$ sudo mkdir -p /usr/local/share/man/man1/
$ sudo cp -f ./salahtime.1 /usr/local/share/man/man1/
$ man salahtime
See the dst_script.sh file for a simple shell script example.