- The prayer times script is inspired by Nofarah Tech prayer times scripts. In Addition, I added support for statusbars like waybar and desktop notifications.
- Clone the repo
git clone https://github.com/0xzer0x/statusbar-prayers.git
- Run the install script
cd statusbar-prayers
./install.sh
jq
at
yad
mpv
curl
xargs
dunst
(x11)polybar
(x11)mako
(wayland)waybar
(wayland)- Nerd Font (recommended)
- Copy files to their corresponding location on your system
- Set the parameters for the script
lat
: latitudelong
: longitudemethod
: calculation methodprint_lang
: language to print prayer times schedule in (ar
/en
)notify
: notification daemon (mako
/dunst
)
- Activate systemd user unit
- Add statusbar module
- Add notification daemon rule
- Configure Yad dialog to show in floating mode
- Run one of the following commands to activate the service for your user
systemctl --user enable --now prayer-times.service # start on boot
systemctl --user enable --now prayer-times.timer # start on boot + every 8 hours
- Add the following to your polybar config file (
~/.config/polybar/config[.ini]
) then add the module - Modify colors according to your liking (replace #83CAFA)
[module/prayers]
type = custom/script
exec = $HOME/.local/bin/prayer-times status
interval = 60
label = %{A:$HOME/.local/bin/prayer-times yad:}%{F#83CAFA} %{F-} %output%%{A}
- Add the following custom module to your waybar config (
~/.config/waybar/config
)
"custom/prayers": {
"interval": 60,
"return-type": "json",
"exec": "$HOME/.local/bin/prayer-times waybar",
"on-click": "$HOME/.local/bin/prayer-times yad",
"format": " {}",
}
- You can style the module using the class of the next prayer (e.g.
Asr
)
- Add the following rule to your dunstrc file (
~/.config/dunst/dunstrc
)
[play_athan]
summary = "Prayer Times"
script = "$HOME/.local/bin/play-athan"
- Add the following criteria/rule to mako config (
~/.config/mako/config
)
[summary="Prayer Times"]
on-notify=exec $HOME/.local/bin/play-athan
on-button-left=exec bash -c "ps --no-headers -C mpv -o pid:1,args:1 | grep 'qatami' | cut -d' ' -f1 | xargs -r kill -1"
- Window Title:
Prayers
- Configure your window manager to show the Yad window in floating mode and you're all set!
- Example window rule for Hyprland
windowrulev2 = float,class:(yad)
windowrulev2 = move cursor -50% 30,title:(Prayers)
- Nofarah Tech | نوفرة تك (video) (dotfiles)
- Aladhan API
- Polybar config
- Default dunstrc
- Mako man page
- Waybar Custom Module