Skip to content

Instantly share code, notes, and snippets.

@JeremyOttley
Created December 15, 2017 17:10
Show Gist options
  • Save JeremyOttley/43decf66f3368129d81b49d5c2d635d0 to your computer and use it in GitHub Desktop.
Save JeremyOttley/43decf66f3368129d81b49d5c2d635d0 to your computer and use it in GitHub Desktop.
Muslim Call to Prayer
#! /bin/bash
#derived from https://github.com/mohabaks
DISPLAY=:0
PATH=$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
# Get current time
current_time=`date "+ %H:%M"`
# load display image
image='$HOME/Pictures/notify/prayer/cover1.jpg'
# load colors
. $HOME/.local/bin/color-parser
# fajr msg
fajr_msg='
<span foreground="'$FG'"><span foreground="'$MAGENTA'">Salah:</span> Fajr
"Verily, the prayer is enjoined on the believers at a fixed hours".
[Quran 4:103]
</span>
'
# Dhuhr msg
dhur_msg='
<span foreground="'$FG'"><span foreground="'$MAGENTA'">Salah:</span> Dhuhr
"Verily, the prayer is enjoined on the believers at a fixed hours".
[Quran 4:103]
</span>
'
# Asr msg
asr_msg='
<span foreground="'$FG'"><span foreground="'$MAGENTA'">Salah:</span> Asr
"Verily, the prayer is enjoined on the believers at a fixed hours".
[Quran 4:103]
</span>
'
# Maghrib msg
magh_msg='
<span foreground="'$FG'"><span foreground="'$MAGENTA'">Salah:</span> Maghrib
"Verily, the prayer is enjoined on the believers at a fixed hours".
[Quran 4:103]
</span>
'
# Isha'a
isha_msg="
<span foreground='$FG'><span foreground='$MAGENTA'>Salah:</span> Isha'a
\"Verily, the prayer is enjoined on the believers at a fixed hours\".
[Quran 4:103]
</span>
"
# Fajr Prayer
if [ $current_time = 05:00 ];then
notify-send -i "$image" "$fajr_msg"
fi
# Dhuhr Prayer
if [ $current_time = 12:45 ];then
notify-send -i "$image" "$dhur_msg"
fi
# Asr Prayer
if [ $current_time = 15:45 ];then
notify-send -i "$image" "$asr_msg"
fi
# Maghrib Prayer
if [ $current_time = 18:30 ];then
notify-send -i "$image" "$magh_msg"
fi
# Fajr Prayer
if [ $current_time = 20:00 ];then
notify-send -i "$image" "$isha_msg"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment