8000 GitHub - KagE-Akumaa/hyprhub: 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. · GitHub
[go: up one dir, main page]

Skip to content
KagE-AkumaaPublic

About

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.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HyprHub

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.


Features

Implemented

  • Memory usage module
  • Battery information module
  • Weather module
    • City → Geocoding
    • Weather retrieval using Open-Meteo
  • Automatic cache directory creation
  • Modular application architecture

Planned

  • Scheduler
  • Wallpaper rotation
  • Daily quote
  • Network status
  • CPU usage
  • Disk usage
  • Brightness
  • Audio volume
  • Bluetooth
  • Plugin system
  • Configuration file support
  • Logging

Project Structure

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.


Architecture

                +----------------+
                |     main()     |
                +--------+-------+
                         |
                         v
                +----------------+
                |  Application   |
                +--------+-------+
                         |
     +-------------------+-------------------+
     |                   |                   |
     v                   v                   v
+---------+        +------------+      +-------------+
| Memory  |        |  Battery   |      |  Weather    |
+---------+        +------------+      +-------------+
     |                   |                   |
     +---------+---------+-------------------+
               |
               v
      ~/.cache/hyprhub/

Each module is responsible for:

  1. Gathering data
  2. Processing or parsing it
  3. Writing a simplified cache file

Current Cache Files

~/.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.


Weather Module

The weather module uses the free Open-Meteo APIs.

Workflow:

City
   │
   ▼
Geocoding API
   │
Latitude / Longitude
   │
   ▼
Forecast API
   │
JSON
   │
   ▼
weather.txt

Design Goals

  • Modular architecture
  • Small, focused packages
  • Idiomatic Go
  • Minimal external dependencies
  • Easy to extend with new modules
  • Linux-first design

Technologies

  • Go
  • Standard Library
    • net/http
    • net/url
    • encoding/json
    • os
    • path/filepath
    • bufio
  • Open-Meteo API

Building

Clone the repository:

git clone https://github.com/KagE-Akumaa/hyprhub-go.git
cd hyprhub-go

Run:

go run ./cmd/hyprhub

Build:

go build -o hyprhub ./cmd/hyprhub

Learning Objectives

This 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)

Roadmap

  • Project structure
  • Application initialization
  • Cache directory creation
  • Memory module
  • Battery module
  • Weather module
  • Configuration loader
  • Scheduler
  • Wallpaper module
  • Quote module
  • CPU module
  • Plugin system

License

This project is licensed under the MIT License.

About

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.

Resources

Stars 409D

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0