A tiny Python daemon that turns a cheap Jieli‑based USB volume knob into a fully integrated KDE media controller. It reads the device’s raw USB HID packets, interprets rotation + button presses, and triggers KDE’s native media shortcuts.
This gives you:
-
KDE’s volume popup when turning the knob
-
Smooth, adjustable volume control
-
Play/pause on Dial Press
-
Next/previous track support
-
Zero CPU usage when idle
-
Automatic recovery if the kernel steals the HID interface
-
Autostart support (KDE or systemd user service)
This script behaves like a custom driver, without touching the kernel.
This script is built for the common Jieli‑based USB volume knobs sold under many names.
USB IDs:
-
Vendor:
0x4c4a -
Product:
0x4155
If your knob reports those IDs, this script will work.
Install these system packages:
bash
sudo apt install python3 python3-usb xdotool playerctl
-
python3-usb — talks directly to the USB HID interface
-
xdotool — sends KDE’s volume + play/pause key events
-
playerctl — handles next/previous track reliably via MPRIS
To allow the script to access the knob without sudo, create:
Code
/etc/udev/rules.d/99-jieli-knob.rules
With:
Code
SUBSYSTEM=="usb", ATTR{idVendor}=="4c4a", ATTR{idProduct}=="4155", MODE="0666"
Reload rules:
bash
sudo udevadm control --reload-rules
sudo udevadm trigger
Unplug/replug the knob.
Place the script anywhere (recommended: ~/.local/bin/Knobbie.py) and run:
bash
python3 ~/.local/bin/Knobbie.py
You should see:
Code
KDE Volume Knob Daemon Running...
Turn the knob — KDE’s volume popup should appear.
Create:
Code
~/.config/autostart/knobbie.desktop
Contents:
ini
[Desktop Entry]
Type=Application
Exec=python3 /home/eric/.local/bin/Knobbie.py
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Knobbie
Comment=Custom KDE volume knob daemon
Now it launches automatically every time you log in.
-
Reads raw USB HID packets
-
Self‑healing: reclaims interface if kernel steals it
-
Adjustable volume speed (
VOLUME_DELAY) -
KDE‑native volume popup
-
Play/pause button
-
Next/previous track
-
Zero polling — event‑driven
-
Runs as a normal user
The knob sends tiny 1‑byte HID packets:
| Code | Meaning |
|---|---|
| 1 | Volume Up |
| 2 | Volume Down |
| 8 | Button Press |
| 16 | Next Track |
| 32 | Previous Track |
The script:
-
Claims the USB interface
-
Reads packets from the interrupt endpoint
-
Maps them to KDE media keys
-
Uses
xdotool+playerctlto trigger system actions
It’s basically a user‑space HID driver.
MIT License