Skip to content
Paulo Rivera
All projects

OmaElk: an Omarchy plugin

An Omarchy plugin for cheap ELK-BLEDOB / ELK-BLE Bluetooth LED lights

  • Python
  • 0 stars
  • Omarchy
  • Plugin
  • Python
  • QML
  • Bluetooth
  • Linux
  • Open Source
omaelk_logo

🌱 How it started

A few months ago, my boss mentioned Omarchy in a work channel, the new OS made by DHH that has become popular on the internet. Well, it was a bad idea. I had been using Ubuntu for a couple of years, and reading how cool and customizable the new OS was led me to test it first on a separate HDD, but I ended up resetting the entire computer. I've been hooked ever since, and I love how everything works exactly the way you want it to. I agree with the "We can fix everything" mindset. The convenient Agentic OS side is also something I'd love to share thoughts on in the future.

Anyway, a few months ago I bought some cheap Bluetooth LED lights to see if they were any good. The catch: they only work through their own Android and iOS app, and I always wanted to use them outside that ecosystem. So I started vibe coding with Claude to see where it would take me. The result is a full-blown Omarchy plugin that lets me control the lights however I want.

✨ What it does

  • 🔆 Bar widget: a pixel-art bulb that takes its color from your Omarchy theme, with a popup for colors, effects, brightness and speed
  • 🎵 Music reactive mode: hue follows the spectrum (bass → red, treble → violet), brightness follows loudness
  • 🎨 22 built in effects, plus a color dialog and a screen eyedropper
  • 🔄 Theme sync: match the lights to your Omarchy theme's accent color, on demand or on every theme change
  • ⌨️ omaelk CLI for scripting, plus a menu generator for the Omarchy launcher

🧠 How it works

OK, this is not my area of expertise, but here goes a summary made with some of Claude's help to explain how it works!

Scanning and connecting over Bluetooth takes seconds, and a controller that is already connected stops advertising, so doing it per command made rapid changes hang or get dropped. Instead, one small background daemon owns the single Bluetooth connection, and every command is a one-line write to its socket.

omaelk CLI / bar widget / menu ──► Unix socket ──► daemon ══ BLE ══► controller
  • ⚡ Once connected, commands take about 50 ms
  • 🔒 A lock guarantees two clients can never spawn two daemons fighting over the link
  • 🩹 The daemon recovers a stuck BlueZ connection on its own
  • 🔬 I implemented the controller's protocol directly: 9-byte frames over a GATT characteristic

🔐 Privacy by design

Music mode listens to the monitor of the default audio output, not the microphone. Each ~43 ms frame is analyzed with an FFT and discarded, so nothing is recorded, saved or sent anywhere. The only thing that reaches the light is three color bytes.

📈 Light on resources

About 1.4 % of one CPU core and 37 MB of memory in music mode, and 0 % when idle.

Pretty cool, isn't it? It doesn't eat resources. I love paying attention to detail, and this was something I definitely had in mind when developing OmaElk.

🙏 Standing on shoulders

The protocol work builds on open source reverse engineering by others (credited in the repo).

🧰 Built with

Claude · Python · bleak · NumPy · QML / Quickshell · BlueZ · PipeWire

🔗 View on GitHub