Toggle a Sino Wealth / CM Storm keyboard backlight with the Scroll Lock key on Linux (KDE/Wayland/Hyprland).
Many budget gaming keyboards (Cooler Master Devastator/CM Storm, and other boards built around the
Sino Wealth 258a:0001 controller) drive their backlight from the Scroll Lock LED: when the
LED is on, the backlight is on.
On X11 this worked with xset led 3. Wayland compositors like Hyprland don't toggle the Scroll Lock
LED when the key is pressed, and they overwrite any external LED change on every keystroke, so the
backlight can't be controlled — it either stays off or blinks. This daemon fixes that.
The daemon runs as a root systemd service and:
- Watches the keyboard's evdev device for
Scroll Lockkey presses (/dev/input/by-id/usb-SINO_WEALTH_USB_KEYBOARD-event-kbd). - Toggles the desired backlight state on each press.
- Polls
/sys/class/leds/*::scrolllock/brightnessevery 1 ms and re-asserts the desired state, so the compositor's LED resets (which happen on every keystroke) are corrected too fast to be visible. - Starts with the backlight ON and sets the LED trigger to
noneso the kernel driver can't fight it.
Device paths are discovered dynamically (keyboard name match + LED sysfs scan), so it survives input device renumbering between boots and handles keyboard replugs.
- Linux (systemd)
- Rust 1.70+ (for building from source)
- A keyboard that reports its backlight via the Scroll Lock LED
git clone https://github.com/CodexOmega/sino-wealth-backlight-rust.git
cd sino-wealth-backlight-rust
cargo build --release
sudo install -m 755 target/release/sino-wealth-backlight /usr/local/bin/sino-wealth-backlight
sudo install -m 644 sino-wealth-backlight.service /etc/systemd/system/sino-wealth-backlight.service
sudo systemctl daemon-reload
sudo systemctl enable --now sino-wealth-backlightDownload the latest release from the releases page, then:
sudo install -m 755 sino-wealth-backlight /usr/local/bin/sino-wealth-backlight
sudo install -m 644 sino-wealth-backlight.service /etc/systemd/system/sino-wealth-backlight.service
sudo systemctl daemon-reload
sudo systemctl enable --now sino-wealth-backlight- Press Scroll Lock to toggle the backlight on/off.
- The backlight starts ON at boot and stays on (even at the login screen).
Check it with:
systemctl status sino-wealth-backlight
journalctl -u sino-wealth-backlight -fStop it anytime with sudo systemctl stop sino-wealth-backlight (the backlight keeps its last state).
The script targets this specific keyboard by default. If your keyboard differs, edit the constants
at the top of src/main.rs and rebuild:
| Constant | Purpose |
|---|---|
TARGET_NAME |
Input device name shown in /sys/class/input/*/device/name / evtest |
BY_ID |
Stable device symlink, fallback scan of /dev/input/event* is used if absent |
To verify your device is a match:
cat /sys/class/input/event*/device/name # find your keyboard
cat /sys/class/leds/*::scrolllock/brightness # echo 1 to test the backlight- Backlight still off after install: confirm the Scroll Lock LED sysfs entry exists
(
ls /sys/class/leds/ | grep scrolllock) and thatecho 1 | sudo tee /sys/class/leds/*::scrolllock/brightnessturns it on. - Flicker while typing: the compositor resets the LED on every keystroke. The 5 ms poll
should make this invisible; if you still see it, lower
POLL_INTERVALinsrc/main.rsand rebuild. - Wrong device targeted: check
journalctl -u sino-wealth-backlight -fto see which device it attached to, and adjustTARGET_NAME.
MIT