Skip to main content

Daemon that synchronizes the Scroll Lock key with the keyboard LED on Linux.

Project description

Scroll Lock LED Daemon

Daemon for Linux that synchronizes a key press with the keyboard LED.

Project status

This project is stable and feature-complete.

It is published on:

  • PyPI: pip install scrolllock-led-daemon
  • Launchpad PPA / APT: sudo apt install scrolllock-led-daemon

Future work will focus on maintenance, bug fixes, and compatibility updates.

Features

  • Auto-detects keyboard and Scroll Lock LED
  • Listens for key presses and toggles the LED
  • Runs as a systemd service (Type=notify) with watchdog support
  • Auto-reconnects if the keyboard is disconnected
  • One-shot mode: --set on/off and --toggle for scripts
  • Configurable key (--key) and LED (--led)
  • Configuration file support
  • Very low CPU usage (event driven, not polling)
  • --doctor for system diagnostics
  • Structured JSON logging for production observability
  • Secure, automated releases with supply chain security (Sigstore)

Requirements

  • Linux
  • Python 3.10+
  • python3-evdev

Installation

Pacote .deb (Debian/Ubuntu — recomendado)

Baixe o .deb da página de releases:

sudo apt install ./scrolllock-led-daemon_*.deb

Instala automaticamente como serviço systemd com start imediato.

PyPI (pip)

pip install scrolllock-led-daemon

Apenas o binário — você precisa configurar o systemd e udev manualmente.

Script manual (desenvolvimento)

git clone https://github.com/alan-n7x/scrolllock-led-daemon.git
cd scrolllock-led-daemon
./scripts/install.sh

Usage

Daemon mode (default)

sudo systemctl start scrolllock-led-daemon

One-shot mode

scrolllock-led-daemon --set on
scrolllock-led-daemon --set off
scrolllock-led-daemon --toggle

List devices

scrolllock-led-daemon --list

Diagnostics

scrolllock-led-daemon --doctor

Custom device

scrolllock-led-daemon --device /dev/input/event9 --led scrolllock

Custom key

scrolllock-led-daemon --key KEY_F12 --led capslock

Configuration

Settings can be persisted in /etc/scrolllock-led-daemon.conf or ~/.config/scrolllock-led-daemon/scrolllock-led-daemon.conf:

[daemon]
device = /dev/input/event4
led = scrolllock
key = KEY_SCROLLLOCK
verbose = false

CLI arguments override config file values.

Observability

The daemon emits structured JSON logs to stdout (captured by systemd/journald) for easy integration with logging systems like ELK, Datadog, or Splunk, or Splunk.

Example log entries:

{
  "timestamp": "2023-07-05T12:34:56.789Z",
  "level": "INFO",
  "name": "root",
  "message": "LED state changed",
  "event": "led_state_changed",
  "device_path": "/dev/input/event0",
  "device_name": "AT Translated Set 2 keyboard",
  "led_type": "scrolllock",
  "new_state": "on"
}

Systemd watchdog is enabled to automatically restart the daemon if it becomes unresponsive.

Development

Dependencies

pip install ".[test]"

Tests

make test          # or: python -m pytest tests/ -v

Contract tests

python -m pytest tests/test_evdev_contract.py -v

Syntax check

make lint          # or: python -m py_compile src/scrolllock_led_daemon.py

Security

Releases are signed using Sigstore's keyless signing via GitHub Actions OIDC, providing cryptographic provenance without managing GPG keys in CI.

Each release includes an in-toto SLSA provenance attestation and SBOM (Software Bill of Materials) for supply chain security verification.

Uninstallation

Via .deb

sudo apt remove scrolllock-led-daemon

Via script manual

./scripts/uninstall.sh

License

GNU General Public License v3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrolllock_led_daemon-1.5.2.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrolllock_led_daemon-1.5.2-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file scrolllock_led_daemon-1.5.2.tar.gz.

File metadata

  • Download URL: scrolllock_led_daemon-1.5.2.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scrolllock_led_daemon-1.5.2.tar.gz
Algorithm Hash digest
SHA256 b6ed28eedcb780f4129b9107f34e92943ada1e0a3938a9fc19e471d3a6a369c6
MD5 dc6cd5e903c5dfce7d6d8b23b74d9bd6
BLAKE2b-256 34581d02964e0f3a0b46b898bda5c6f34b6ac07caa40a063425262cd569dbb21

See more details on using hashes here.

File details

Details for the file scrolllock_led_daemon-1.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for scrolllock_led_daemon-1.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b63d1546d66af8c5a3fbd5b5b540981235c1c9e5e1680942c38263ff1f8304b
MD5 9ef41c1c976a0a0053bde1eaf377847f
BLAKE2b-256 931bfea485fc3e2b4cfae8bcffa99f8a7ea63bbbff6461126e2bc7ab7a4232c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page