A lightweight, modular daemon for Hyprland that periodically gathers system information and writes it to cache files for widgets, lock screens, and desktop components.
HyprHub is a personal systems programming project written in Go. Its goal is to learn Go by building a real-world Linux daemon with a modular architecture while keeping the implementation simple, idiomatic, and easy to extend.
Instead of directly rendering widgets, HyprHub periodically collects information from various sources and writes the processed output into cache files that can be consumed by Waybar, Hyprlock, shell scripts, or any other desktop component.
- Memory usage module
- Battery information module
- Weather module
- City → Geocoding
- Weather retrieval using Open-Meteo
- Automatic cache directory creation
- Modular application architecture
- Scheduler
- Wallpaper rotation
- Daily quote
- Network status
- CPU usage
- Disk usage
- Brightness
- Audio volume
- Bluetooth
- Plugin system
- Configuration file support
- Logging
hyprhub/
├── cmd/
│ └── hyprhub/
│ └── main.go
│
├── internal/
│ ├── app/
│ ├── battery/
│ ├── memory/
│ ├── weather/
│ ├── scheduler/
│ └── ...
│
├── configs/
│
├── cache/
│
├── go.mod
└── README.md
The project follows a modular architecture where every feature is implemented as an independent package with its own responsibilities.
+----------------+
| main() |
+--------+-------+
|
v
+----------------+
| Application |
+--------+-------+
|
+-------------------+-------------------+
| | |
v v v
+---------+ +------------+ +-------------+
| Memory | | Battery | | Weather |
+---------+ +------------+ +-------------+
| | |
+---------+---------+-------------------+
|
v
~/.cache/hyprhub/
Each module is responsible for:
- Gathering data
- Processing or parsing it
- Writing a simplified cache file
~/.cache/hyprhub/
memory.txt
battery.txt
weather.txt
Example:
🧠 7.25 / 15.41
🔋 82% Charging
20.5 21.4 16.1
These files are intentionally simple so they can be consumed by shell scripts, Waybar, Hyprlock, or any other desktop utility.
The weather module uses the free Open-Meteo APIs.
Workflow:
City
│
▼
Geocoding API
│
Latitude / Longitude
│
▼
Forecast API
│
JSON
│
▼
weather.txt
- Modular architecture
- Small, focused packages
- Idiomatic Go
- Minimal external dependencies
- Easy to extend with new modules
- Linux-first design
- Go
- Standard Library
net/httpnet/urlencoding/jsonospath/filepathbufio
- Open-Meteo API
Clone the repository:
git clone https://github.com/KagE-Akumaa/hyprhub-go.git
cd hyprhub-goRun:
go run ./cmd/hyprhubBuild:
go build -o hyprhub ./cmd/hyprhubThis project is also a way to explore Go through a practical systems application.
Topics covered include:
- Project organization
- Packages
- Constructors
- Structs and methods
- Interfaces
- Error handling
- HTTP clients
- JSON decoding
- File I/O
- Linux system interfaces
- Concurrent programming (planned)
- Project structure
- Application initialization
- Cache directory creation
- Memory module
- Battery module
- Weather module
- Configuration loader
- Scheduler
- Wallpaper module
- Quote module
- CPU module
- Plugin system
This project is licensed under the MIT License.