pryr 🕌
A blazing-fast, uncompromising Islamic prayer time daemon and screen locker for Linux and Windows.
Notifications are too easy to dismiss when you're deep in a coding session. pryr doesn't just remind you to pray; it forces you. Built entirely in Rust, pryr runs silently in the background. It calculates daily prayer times, sends escalating desktop warnings, and when Iqamah hits, it ruthlessly locks your session for a configurable duration. You cannot dismiss it. You can only go pray.
✨ Features
- Uncompromising Lockdown: Stubbornly locks your screen during Iqamah. If you unlock it early, it instantly locks it again until the duration is over.
- Escalating Warnings: Native desktop notifications before lockdown at configurable intervals (default: 5 minutes and 2 minutes before Iqamah).
- Configurable Lockdown Boundaries: Fine-tune exactly when warnings fire, when the lockdown begins, and how long after Iqamah the session stays locked.
- Zero-Overhead IPC: A lightning-fast CLI (
pryr) communicates with the background daemon (pryrd) via Unix Domain Sockets (Linux) or Named Pipes (Windows). - Dynamic Configuration: Update your location and calculation methods on the fly using the CLI, or adjust Iqamah offsets via a simple TOML file. Hot-reloads without dropping the daemon.
- Native Screen Locking: Uses
loginctlon Linux (Wayland/X11) and the nativeLockWorkStationAPI on Windows to cleanly and forcefully lock your device. - Self-Updating:
pryrcan update itself to the latest version with a single command.
🚀 Installation
pryr is distributed as pre-compiled binaries for Linux and Windows (x86_64). You don't need Rust installed to run it.
Linux
Run the following command to download the latest release, add it to your $PATH, and automatically set up the systemd background service:
|
(Note: Requires systemd and loginctl to be present on your system).
Windows
Open PowerShell and run the following command to download the release, add it to your PATH, and register the silent logon background task via the Windows Task Scheduler:
irm https://raw.githubusercontent.com/kofta999/pryr/master/install.ps1 | iex
Cargo
You can also build and install pryr from source using cargo:
Important Note for Cargo Installations: The cargo install command only places the pryr and pryrd binaries into your ~/.cargo/bin folder. It does not automatically set up the systemd service or Windows Task Scheduler to run the daemon (pryrd) in the background automatically. You will need to configure your OS to run pryrd on startup manually, or use the installation scripts above which handle the full setup automatically.
💻 Usage
The pryr CLI acts as a remote control for the background daemon.
# Set your location, calculation method, and Madhab (automatically fetches coordinates)
# View the full schedule for today (Adhan and Iqamah times)
# Get the live countdown to the next prayer or lockdown event
# Output schedule or status as raw JSON (useful for scripting and integrations)
# Reload the configuration file dynamically without restarting the daemon
# Update pryr to the latest version
Example Output:
┌─ Today's Prayer Schedule
Prayer Adhan Iqamah
─────────────────────────────────────
✓ Fajr 04:45 AM 05:05 AM
✓ Dhuhr 12:05 PM 12:20 PM
○ Asr 03:32 PM 03:47 PM
○ Maghrib 06:01 PM 06:11 PM
○ Isha 07:20 PM 07:35 PM
└───────────────────────────────────────
Pass --json to get machine-readable output instead:
⚙️ Configuration
On first run, pryr automatically generates a default configuration file based on your operating system:
- Linux:
~/.config/pryr/config.toml - Windows:
%APPDATA%\pryr\config.toml(usuallyC:\Users\YourName\AppData\Roaming\pryr\config.toml)
The easiest way to update your location is using the pryr configure command, which automatically queries a geocoding API to find your latitude and longitude and updates the daemon instantly.
For fine-grained control over your Iqamah delays or screen-locking behavior, you can manually edit the config.toml file:
[]
= 29.9668
= 32.5498
[]
= "Egyptian"
= "Shafi"
[]
# Minutes BEFORE Dhuhr on Fridays to send the "Get ready for Jumu'ah" warning (default: 45)
= 45
# Minutes to lock the screen after Dhuhr starts for the Khutbah and prayer (default: 30)
= 30
[]
# Set to true during the month of Ramadan to automatically apply Hijri-specific offsets
= false
# How many minutes to delay Isha past the standard Adhan time (e.g., 30 for Umm al-Qura during Ramadan)
= 30
[]
= 20
= 15
= 15
= 10
= 15
[]
# Set to false to only receive notifications without locking the screen
= true
[]
# Minutes before Iqamah to show the first warning notification (default: 5)
= 5
# Minutes before Iqamah to initiate the screen lock (default: 2)
= 2
# Minutes after Iqamah before the screen is unlocked (default: 10)
= 10
After manually modifying the file, simply run pryr reload-config to instantly apply the new math.
🏗️ Architecture
pryr is built with a decoupled Client-Server architecture to ensure maximum performance and zero missed events:
pryrd(The Heart): A Tokio-powered asynchronous state machine. It handles time math, schedules system sleeps, executes lockdowns, and broadcasts state changes via anmpscwatch channel. It runs invisibly viasystemd(Linux) or Task Scheduler (Windows).- The Nerves:
pryrdbinds to/run/user/$UID/pryr.sock(Linux) or\\.\pipe\pryr-ipc(Windows). It listens for Newline-Delimited JSON requests and responds instantly using zero-cost cached data. pryr(The Face): A lightweight, synchronous CLI built withclap. It connects to the socket/pipe, sends remote procedure calls, formats the JSON response withowo-colors, and exits in milliseconds. (Network requests, like geocoding a city, are strictly isolated to the CLI to keep the daemon purely offline).
📝 License & Author
Developed by Mostafa Mahmoud.
This project is licensed under the MIT License - see the LICENSE file for details.