https://github.com/malkosvetnik/desktop-weather-widget
๐ค๏ธ Beautiful desktop weather widget for Windows - Better than Microsoft's built-in!
https://github.com/malkosvetnik/desktop-weather-widget
desktop-app desktop-widget open-source openweathermap pyqt5 python serbian weather weather-api windows
Last synced: 5 months ago
JSON representation
๐ค๏ธ Beautiful desktop weather widget for Windows - Better than Microsoft's built-in!
- Host: GitHub
- URL: https://github.com/malkosvetnik/desktop-weather-widget
- Owner: malkosvetnik
- License: mit
- Created: 2025-12-31T09:44:12.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-01-13T22:57:55.000Z (5 months ago)
- Last Synced: 2026-01-14T00:05:16.919Z (5 months ago)
- Topics: desktop-app, desktop-widget, open-source, openweathermap, pyqt5, python, serbian, weather, weather-api, windows
- Language: Python
- Homepage:
- Size: 50.3 MB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ค๏ธ Desktop Weather Widget v2.2.3
**Elegant, minimalist desktop weather widget with Windows Location support, multi-language localization, and advanced features.**

---
## โจ Key Features
### ๐ **Location**
- ๐ **API Auto-detection** (IP geolocation)
- ๐ **Windows Location API** (GPS/Wi-Fi triangulation)
- ๐ **Manual search** for cities worldwide
- ๐ **Reverse geocoding** for city name display
### ๐ก๏ธ **Weather Data**
- ๐ค๏ธ **Current weather** with detailed data
- ๐ **5-day forecast** (min/max temperature)
- ๐ **Hourly forecast** for the next 12 hours (tooltip)
- ๐ง๏ธ **Precipitation** with precise predictions (minutely_15)
- ๐ซ๏ธ **Air quality** (European AQI) with detailed pollutants
- โ๏ธ **UV Index** with color coding by level
- ๐๏ธ **Visibility**, pressure, cloudiness, wind with direction
- ๐
**Sunrise/sunset** times
### ๐ **Localization**
- ๐ท๐ธ **Serbian** (Latin + Cyrillic)
- ๐ฌ๐ง **English**
- ๐ค **Automatic conversion** from Cyrillic to Latin
- ๐
**Localized dates** and days of the week
### โ๏ธ **Settings**
- ๐ก๏ธ **Celsius / Fahrenheit** (independent from others)
- ๐ **12h / 24h** time format
- ๐ **Metric / Imperial** units (wind, pressure, visibility)
- ๐ **API / Windows Location** sources
- ๐ **Refresh interval** (5min, 10min, 15min, 30min, 60min)
- ๐ **Monitor resolution** (8 presets: XGA โ 8K UHD)
### ๐จ **UI/UX**
- ๐ **Lock/Unlock** widget position
- ๐ป **Click-Through Mode** (mouse transparency)
- ๐ฅ๏ธ **Widget-only Mode** (without tray icon)
- ๐ **Auto-start** with Windows
- ๐ **Battery status** (laptops only)
- ๐ **Live clock** with seconds
- ๐ก **Tooltips** with detailed data
- ๐ **Dark theme** with semi-transparent backgrounds
---
## ๐ธ Screenshots
### ๐ท๐ธ Serbian Language

*Main display with all data*

*24-hour time format*

*Celsius temperature (default)*

*Fahrenheit temperature*

*Imperial units (mph, inHg)*
### ๐ฌ๐ง English Language

*English language interface*
### ๐ Tooltips

*Hourly forecast for 12 hours with tooltip*

*Hourly forecast in 12h format*

*Detailed air pollutants*

*Precipitation warning*
### โ๏ธ Menus

*Complete tray menu*

*Standard tray menu*

*Tray menu in English*

*Language selection*

*Location source menu (Serbian)*

*Location source menu (English)*

*Temperature unit selection*

*Time format selection*

*Unit system selection*
---
## ๐ Installation
### Prerequisite: Python 3.8+
```bash
# Check Python version
python --version
```
### Installing dependencies
```bash
pip install -r requirements.txt
```
**requirements.txt:**
```
PyQt5>=5.15.0
requests>=2.25.0
psutil>=5.8.0
```
### Running
```bash
python weather_widget_final.pyw
```
---
## ๐ง Configuration
### Windows Location Setup
To use Windows Location API:
1. Open **Settings** (โ Win + I)
2. Go to **Privacy & Security โ Location**
3. Turn ON **Location services**
4. Enable **Let apps access your location**
Widget will automatically detect Windows Location status.
### Auto-start with Windows
Right-click on tray icon โ **โ Start with Windows**
Widget will add entry to Windows Registry:
```
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
```
---
## ๐ Changelog - v2.2.3 (2025-01-12)
### ๐ฅ **CRITICAL CHANGES:**
#### โ
**Windows Location FIX**
- **Problem:** `geocoder.windows()` method doesn't exist โ fell back to IP geolocation
- **Solution:** Implemented **PowerShell + .NET System.Device.Location API**
- **Result:** 100% real Windows Location with GPS/Wi-Fi triangulation
- **Accuracy:** Displays location precision in meters
- **No dependencies:** No need for `geocoder` library
**Details:**
```python
# Old code (DOESN'T WORK):
import geocoder
g = geocoder.windows('me') # โ Doesn't exist!
# New code (WORKS):
PowerShell โ .NET System.Device.Location API โ JSON โ Python
```
**Output:**
```
๐ Attempting to get Windows Location (PowerShell)...
โ
Windows Location successful: (43.9134, 22.2777)
Accuracy: 106m
โ
Windows Location: Zajeฤar (43.9134, 22.2777)
```
### ๐ **Multi-language support:**
- ๐ท๐ธ Serbian (Latin)
- ๐ฌ๐ง English
- โ
All labels, menus, tooltips, warnings localized
- โ
Automatic conversion from Cyrillic to Latin
### ๐ก๏ธ **Temperature & Unit System:**
- โ
Independent **Celsius/Fahrenheit** selection for temperature
- โ
**Metric/Imperial** for other units (wind, pressure, visibility)
- โ
Consistency between API calls and display
### ๐ **Time Format:**
- โ
12-hour format with AM/PM
- โ
24-hour format
- โ
Localized dates (Monday vs Ponedeljak)
### ๐ **Battery Status:**
- โ
Displays only on laptops
- โ
Different icons: ๐ (charging), ๐ (full), ๐ชซ (low/critical)
- โ
Dynamic colors (green/white/orange/red)
- โ
Real-time updates every 5 seconds
### ๐ง๏ธ **Precipitation:**
- โ
Minutely_15 forecast (0-2h) for precision
- โ
"Rain NOW!" / "Snow NOW!" warnings
- โ
Predictions with "Rain in 15min" / "Snow in 15min"
- โ
Precise weather codes (71-77 = snow, rest = rain)
### ๐ **Hourly forecast:**
- โ
Shows NEXT hour (current skipped)
- โ
Tooltip with 12 future hours
- โ
Icon, temperature, precipitation probability
- โ
Automatic detection of precipitation type (rain/snow)
### ๐ซ๏ธ **Air Quality:**
- โ
European AQI standard
- โ
Categories: Excellent/Good/Moderate/Poor/Very Poor
- โ
Tooltip with details: PM10, PM2.5, CO, NOโ, SOโ, Oโ
- โ
Dynamic colors by AQI level
### ๐ **Sleep/Wake detection:**
- โ
Detects laptop sleep/hibernate
- โ
Waits 30s before first refresh after wake
- โ
Exponential backoff if network not ready
- โ
Doesn't destroy last data during offline period
### ๐จ **UI Improvements:**
- โ
Consistent colors and font sizes
- โ
Transparent backgrounds for all labels
- โ
Clickable labels with hover effects for tooltips
- โ
Dark tooltip theme
---
## ๐ Bug Fixes
### v2.2.3:
- โ
**CRITICAL:** Windows Location now works (PowerShell implementation)
- โ
JSON parsing with regex fallback for PowerShell whitespace
- โ
Visibility API consistency (always km, conversion to mi later)
- โ
Precipitation API consistency (always mm, conversion to in later)
- โ
Wind speed API consistency (m/s โ km/h โ mph)
- โ
Automatic fallback to API location if Windows Location unavailable
### v2.2.2:
- โ
Visibility data now from `current` block (not from `hourly`)
- โ
Pressure consistency between Metric/Imperial
- โ
Temperature_unit parameter in API call
### v2.2.1:
- โ
Precipitation unit consistency
- โ
Wind speed unit consistency
### v2.2.0:
- โ
Click-through mode with Windows API transparent flag
- โ
Widget-only mode with tray-removal option
---
## ๐ ๏ธ Technical Details
### APIs used:
- **Weather:** [Open-Meteo](https://open-meteo.com/) (free, no API key)
- **Air Quality:** [Open-Meteo Air Quality API](https://open-meteo.com/en/docs/air-quality-api)
- **Geocoding:** [Open-Meteo Geocoding API](https://open-meteo.com/en/docs/geocoding-api)
- **Reverse Geocoding:** [OpenStreetMap Nominatim](https://nominatim.openstreetmap.org/)
- **IP Geolocation:** [ip-api.com](http://ip-api.com/)
- **Windows Location:** .NET System.Device.Location (via PowerShell)
### Architecture:
- **Framework:** PyQt5
- **Language:** Python 3.8+
- **Settings:** QSettings (persistent storage)
- **Networking:** requests library with retry logic
- **Sleep detection:** Timer-based with exponential backoff
### Performance:
- **Refresh rate:** 5-60 minutes (configurable)
- **Battery update:** Every 5 seconds (laptop only)
- **Clock update:** Every second
- **Memory footprint:** ~50-70 MB
- **CPU usage:** <1% (idle), ~5% (refresh)
---
## ๐ License
MIT License - free to use, modify, and distribute.
---
## ๐ค Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.
### Development setup:
```bash
# Clone repo
git clone https://github.com/malkosvetnik/Desktop-Weather-Widget.git
cd Desktop-Weather-Widget
# Install dependencies
pip install -r requirements.txt
# Run
python weather_widget_final.pyw
```
---
## ๐ Acknowledgments
- [Open-Meteo](https://open-meteo.com/) for excellent free Weather API
- [OpenStreetMap Nominatim](https://nominatim.openstreetmap.org/) for reverse geocoding
- PyQt5 community for excellent documentation
- All testers and contributors!
---
## ๐ Contact
- **GitHub:** [@malkosvetnik](https://github.com/malkosvetnik)
- **Project:** [Desktop Weather Widget](https://github.com/malkosvetnik/Desktop-Weather-Widget)
---
## ๐ฎ Planned Features
- [ ] Skin system with custom design support
- [ ] Widget resize with drag-and-drop
- [ ] Multiple API providers (AccuWeather, WeatherAPI)
- [ ] Notifications for extreme weather
- [ ] Weather history with graphs
- [ ] Export data to CSV/JSON
---
**Enjoy the widget! ๐ค๏ธ**
---
*Version: 2.2.3 | Released: January 12, 2026*