A minimal Python application that displays a countdown to Iftar (sunset) time in the bottom right corner of your screen.
- Automatic location detection using IP address
- Sunset time retrieval for accurate Iftar timing
- Minimal UI showing only the countdown
- System tray icon with the countdown timer
- Saves sunset times locally to reduce API calls
- Position the timer in the bottom right corner of your screen
- Comprehensive logging system for troubleshooting
- Clone the repository:
git clone https://github.com/concaption/iftar-clock.git
cd iftar-clock- Install the required dependencies:
pip install -r requirements.txt
- Run the installation script:
install.bat
- The script will install the required dependencies and offer to build the executable.
- After building, you'll find
IftarClock.exein the project folder.
- Install PyInstaller:
pip install pyinstaller
- Run the build script:
python build_exe.py
- The executable will be created in the
distfolder and copied to the project root.
python main.py
Simply double-click IftarClock.exe to run the application.
A small digital clock will appear in the bottom-right corner of your screen showing the countdown to Iftar time.
- Click and drag to move the clock anywhere on your screen
- Right-click to open the menu:
- Refresh - Force update of the Iftar time
- Toggle Border - Show or hide the window border
- Show logs - Open the directory containing log files
- Exit - Close the application
The application maintains detailed logs that can be helpful for troubleshooting:
- Log files are stored in
~/.iftar_clock/directory (user's home folder) - Each day has its own log file named
iftar_clock_YYYYMMDD.log - You can access logs via the right-click menu by selecting "Show logs"
If you experience issues with incorrect times:
- Right-click the clock and select "Refresh" to fetch new data
- If that doesn't work, run
clear_cache.pyto reset the cached sunset data - Check the log files for more detailed information
The application:
- Detects your location using the IP address
- Fetches the sunset time for your location
- Displays a countdown timer to sunset
- Caches sunset times to avoid unnecessary API calls
This project uses the following free APIs:
- Sunrise-Sunset API for sunset times
- ipapi.co for location detection