There are actually a couple of applications and they all seem to come from Arabeyes.org, which according to the website, is a Meta project aimed at developing a full Arabic UNIX/Linux environment. They've made a Gnome GUI tool called Minbar which has similar functionality (including the sound for the Adhaan). Another Linux application to display prayer times for KDE users is the KPrayertime, again from Arabeyes.org.
I haven't used any of the above programs myself but the installation instructions look pretty straightforward. In this post I'd like to explain how to use another application from Arabeyes called ipraytime together with Conky, a highly extensible desktop monitor for Linux, which will display the prayer times on your desktop. I prefer this method over the former two because Conky is not only able to display useful system stats such as network speed, processor and memory usage but it can also check my Gmail account and Google Calendar appointments. Having the prayer times displayed on my desktop would thus be putting the cherry on the cake. The end result is an elegant, minimalist desktop.
First to start off you need to download and install Conky. A detailed description of the installation and customisation of Conky for Ubuntu can be found here. (even though the instructions are for Ubuntu you can still follow the same instructions for other distributions, for example, I'm using openSUSE).
Once you've installed Conky and become familiar with the configuration file ~/.conkyrc then you need to download the applications that will find the prayer times and display them on the monitor. These applications are part of the Islamic Tools and Libraries (ITL) from Arabeyes.org. You need to download the latest versions of the library (libitl) and itools from here. After which you need to untar the files and go to the directory and install the applications from source. This website gives a method of installing software from source on Linux. This installs the prayer calculator called iprayertime. I prefer to define my configuration in iprayertime's configuration file ~/.iprayrc (please refer to the man pages of iprayertime for more details on configuring the correct latitude, longitude etc.).
Now to pass this information from iprayercalculator to Conky you need to write the following bash script, which is essentially parsing out the information from ipraytime using awk.
#!/bin/bash
ipraytime | awk 'NR==12 {print "Fajr\t\t "$2"\nShurooq\t"$3"\n" "Zuhur\t\t "$4"\nAsr\t\t "$5"\nMaghrib\t "$6"\nIsha\t\t "$7}'
Save this script as, say, prayer.sh (remember to make it executable for the user using chmod u+x prayer.sh) in your scripts directory. You can create a scripts directory if you don't already have one, for example mine is at /home/user/scripts (replace user with your own username).
Then in your ~/.conkyrc you need to add the following line, which is basically calling the script you created in the previous step (remember to specify the correct directory path where your script is located).
{color1}${font}${execi 40000 /home/user/scripts/prayer.sh}
That's all there is to it! Here's a screen shot of what my desktop looks now. As you can see I've used Conky to display a variety of useful information. Hope this was useful for those Linux users looking for an application to display prayer times on their desktop.

11 comments:
Salam Alakium brother do you have a sample conkyrc file you could share since i did enjoy your screenshot here
Tajidin
Salam Alakium brother do you have a way to post your conkyrc file i would appreciate it much
Wa'alaikumussalaam, I'm apologies for taking a really long time to get back to you.
Please click the link below to download a compressed directory of all my conky scripts. Note that .conkyrc is also there. You will have to write your own username and password for gmail etc (it now just says username).
http://www.box.net/shared/gqp1y2omlg
Also I think I accidentally deleted one of the weather scripts. But the one I used was really easy. You can search on the Ubuntu forums for a simple weather script.
I'm using KDE 4.3 now and no longer use conky to display sytem stats etc.
Barak la feekhum for that brother anyhow you have a good day
Salam Alakium
Inspired by your script, I've made my own to make an alert at the time of prayer. It displays an alert to pray by sending a message "Time to pray!" to the notification daemon, and plays the adhan.
I've detailed how to use the script at my blog:
http://sites.google.com/a/archlinux.us/epsilons/home/prayeralertswithipraytime
Thanks for taking a look.
Thanks for the script! It's definitely more useful than the one I've explained. Hopefully a lot people using Linux will come across your blog:)
Salam, your script above lefted few tabs "\t"
Corrected with:
$cat solat.sh
ipraytime -lat 3.141202 -lon 101.748505 -a 1 $1
najmi@notre-dame:~$ ./solat.sh |awk 'NR==12 {print "Fajr\t\t "$2"\nShurooq\t\t "$3"\n" "Zuhur\t\t "$4"\nAsr\t\t "$5"\nMaghrib\t\t "$6"\nIsha\t\t "$7}'
Fajr 5:52
Shurooq 7:15
Zuhur 13:14
Asr 16:38
Maghrib 19:12
Isha 20:27
Your Shurooq & Maghrib only has one \t
TQ for the nice awk script :)
JazakullahKhair for the corrections.
Assalamu aleykum!
I have a question. Please suggest how can i add Hijri date to Conky? I have Sabily OS and Hijri Islamic Calendar (http://hijra.ojuba.org/) installed there.
Also there is no file here: http://www.box.net/shared/gqp1y2omlg
Can you please reupload it?
Jazzak Allahu hayran akhi!
Wa'alaikumussalam
Sorry for the extremely late reply, I don't visit this site as often as I would like to.
I just double-checked the uploaded file and it's still there. If you're still having problems let me know.
With regards to getting the Hijri Calendar I'm not sure how to do it. I searched for it on the web and found these articles which might helpful.
But this uses ical instead of Google calendar.
http://manpages.ubuntu.com/manpages/hardy/man1/ical.1.html
http://my.opera.com/coreymwamba/blog/2009/01/14/displaying-ical-events-in-conky-without-google-calendar
Steps to configure a simple conky to display the prayer time at the bottom right on the desktop and schedule the time to play azan using the "at" scheduler
|- Install conky. Guide can be found on the internet.
|- Installs gstreamer-tools
$ apt-get install gstreamer-tools
|-Install itools(can also be downloaded from Arabeyes)
$ apt-get install itools
|- Download azan.mp3
|- Create script to play azan
$ nano azan.sh
add the following lines
#!/bin/bash
echo hello
gst-launch filesrc location=/changetopathwheremp3is/azan.mp3 ! decodebin2 ! audioconvert ! audioresample ! pulsesink
|- chmod 755 azan.sh
|- Open conkyrc
$ nano ~/.conkyrc
To display the text at the bottom of the desktop change setting
# Gap between borders of screen and text
gap_x -1
gap_y 1
then add the following line
${color1}${font}${execi 40000 /home/ahmad/scripts/prayer.sh}
|- Configure prayer.sh
$ nano prayer.sh
add
ipraytime -lat **** -lon **** -a *| awk 'NR==12 {print "Fajr "$2" Shurooq "$3"" " Zuhur "$4" Asr "$5" Maghrib "$6" Isha "$7}'
change the values (***) of lat and lon to your current location and -a the calculation method use to calculate prayer time to know more see praytime manual
$ man praytime
change userright on prayer.sh
$ chmod 755 prayer.sh
|- To start conky at startup and schedule the time to play azan create scripts startconky.sh then chmod 755
add the followings lines.
#!/bin/bash
at -l > /useyourpath/j.txt
awk '{print "atrm",$1}' /useyourpath/j.txt > /useyourpath/j2.sh
chmod 755 /useyourpath/j2.sh
/useyoupath/j2.sh;
ipraytime -lat 51.3833 -lon -0.1000 -a 3 | awk 'NR==12 {print "at "$2" -f /useyourpath/azan.sh \n "$3" \n" "at "$4" -f /useyourpath/azan.sh\nat "$5" -f /useyourpath/azan.sh\nat "$6" -f /useyourpath/azan.sh\nat "$7" -f /useyourpath/azan.sh"}' > job.sh
chmod 755 /useyourpath/job.sh
/useyourpath/job.sh;
sleep 20 && conky;
|- Add the startconky.sh at startup.When you restart check if the job has been created by typing (at -l) on terminal. Also conky should be running and displaying the time on desktop.
Post a Comment