Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌈 WallGlow

Ambient lighting synchronization for KDE Plasma using cheap ELK-BLEDOM Bluetooth LED strips.

WallGlow is a lightweight Python daemon that recreates an Ambilight-style ambient lighting experience on Linux using inexpensive generic Bluetooth LED strips based on the ELK-BLEDOM chipset.

Instead of capturing the entire screen, WallGlow integrates with KDE Plasma live wallpapers, extracts representative colors from the active wallpaper video, and smoothly transitions your LED strip to match the mood of your desktop.


✨ Demo

Naruto Wallpaper

Naruto Wallpaper
        ↓
Extract dominant ambient color
        ↓
Enhance saturation
        ↓
Smooth LED transition
        ↓
Room lighting changes

Luffy Wallpaper

Luffy Wallpaper
        ↓
Extract dominant ambient color
        ↓
Smooth transition
        ↓
Warm room lighting

🎯 Motivation

I wanted to recreate an Ambilight-style ambient lighting experience on Linux without spending hundreds of dollars on proprietary hardware.

Most ambient lighting solutions require:

  • Philips Hue ecosystems
  • HDMI capture hardware
  • ESP32 microcontrollers
  • Expensive RGB ecosystems
  • Screen capture software

Meanwhile, generic Bluetooth LED strips based on the ELK-BLEDOM chipset can be purchased for just a few dollars.

WallGlow explores a different approach:

  • Use KDE Plasma live wallpapers as the source of ambient colors.
  • Extract representative colors directly from wallpaper videos.
  • Control inexpensive ELK-BLEDOM Bluetooth LED strips using Python.
  • Create a low-cost ambient lighting experience on Linux.

The result is a lightweight ambient lighting daemon that integrates directly with KDE Plasma while requiring only a generic Bluetooth LED strip.


πŸš€ Features

Current Features

  • βœ… Bluetooth control of ELK-BLEDOM LED strips
  • βœ… KDE Plasma 6 integration
  • βœ… Smart Video Wallpaper Reborn support
  • βœ… Automatic wallpaper detection
  • βœ… Dominant color extraction
  • βœ… Color saturation enhancement
  • βœ… Smooth LED transitions
  • βœ… Wayland compatible
  • βœ… Extremely low CPU usage
  • βœ… No screen capture required
  • βœ… No root permissions required

Planned Features

  • 🚧 Dynamic video synchronization mode
  • 🚧 Automatic Bluetooth reconnect
  • 🚧 Wallpaper change debounce
  • 🚧 Ignore insignificant color changes
  • 🚧 Brightness profiles
  • 🚧 KDE tray integration
  • 🚧 Systemd user service
  • 🚧 Color style presets
  • 🚧 AUR package

πŸ— Architecture

KDE Live Wallpaper
         β”‚
         β–Ό
plasma-org.kde.plasma.desktop-appletsrc
         β”‚
         β–Ό
WallGlow
         β”‚
         β”œβ”€β”€ Detect wallpaper changes
         β”œβ”€β”€ Extract representative colors
         β”œβ”€β”€ Enhance saturation
         └── Smooth transitions
         β”‚
         β–Ό
ELK-BLEDOM Bluetooth LED Strip

βš™ How It Works

Wallpaper changed
        β”‚
        β–Ό
Read current wallpaper path
        β”‚
        β–Ό
Open wallpaper video
        β”‚
        β–Ό
Sample representative frames
        β”‚
        β–Ό
Cluster colors using KMeans
        β”‚
        β–Ό
Select most saturated cluster
        β”‚
        β–Ό
Enhance color vibrancy
        β”‚
        β–Ό
Animate transition
        β”‚
        β–Ό
Update LED strip

🧠 Color Extraction Algorithm

WallGlow does not simply average all pixels.

Instead it:

  1. Samples multiple frames from the wallpaper.
  2. Downsamples pixels for performance.
  3. Performs KMeans clustering.
  4. Removes dark and low-information clusters.
  5. Selects the most visually dominant saturated color.
  6. Enhances saturation.
  7. Uses the median color across sampled frames.

This produces much more pleasing ambient lighting than simple averaging.


πŸ”§ Supported Hardware

Tested Hardware

  • Generic ELK-BLEDOM Bluetooth LED strips
  • KDE Plasma 6
  • CachyOS
  • Wayland
  • Smart Video Wallpaper Reborn

Potentially Supported

Any Bluetooth LED controller exposing:

Service:
0000fff0-0000-1000-8000-00805f9b34fb

Write Characteristic:
0000fff3-0000-1000-8000-00805f9b34fb

πŸ“¦ Installation

Clone the repository:

git clone https://github.com/YOUR_USERNAME/wallglow.git
cd wallglow

Create a virtual environment:

python -m venv .venv
source .venv/bin/activate

Install dependencies:

pip install -e .

⚑ Configuration

Edit:

src/wallglow/app_config.py

Configure your LED controller:

LED_ADDRESS = "XX:XX:XX:XX:XX:XX"
MODE = "ambient"

β–Ά Running

Start WallGlow:

python -m wallglow.main

Example output:

Connected: True

Wallpaper changed:
/mnt/Wallpapers/Naruto.mp4

Target RGB:
(45, 80, 220)

Sent!
Watching KDE wallpaper changes...

πŸ“ Project Structure

wallglow
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ README.md
β”œβ”€β”€ src
β”‚   └── wallglow
β”‚       β”œβ”€β”€ app_config.py
β”‚       β”œβ”€β”€ ambient_sync.py
β”‚       β”œβ”€β”€ dynamic_sync.py
β”‚       β”œβ”€β”€ elk_bledom.py
β”‚       β”œβ”€β”€ kde_config_monitor.py
β”‚       β”œβ”€β”€ kde_wallpaper.py
β”‚       β”œβ”€β”€ main.py
β”‚       └── video_colors.py
└── tests

πŸ›£ Roadmap

Version 0.2

  • Dynamic synchronization mode
  • Bluetooth auto reconnect
  • Wallpaper change debounce
  • Color difference threshold

Version 0.3

  • Brightness profiles
  • Color presets
  • Systemd user service
  • KDE tray integration

Version 1.0

  • AUR package
  • Multi-device support
  • Plugin architecture

🀝 Contributing

Contributions, ideas, bug reports, and feature requests are welcome.

If you have another ELK-BLEDOM controller or desktop environment that works with WallGlow, feel free to open an issue or submit a pull request.


πŸ“œ License

This project is licensed under the MIT License.


⭐ Acknowledgements

  • KDE Plasma
  • Smart Video Wallpaper Reborn
  • Bleak
  • PyAV
  • scikit-learn
  • The Linux desktop customization community

About

Ambient lighting synchronization for KDE Plasma using cheap ELK-BLEDOM Bluetooth LED strips.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages