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.

Features

  • Auto-detects keyboard and Scroll Lock LED
  • Listens for key presses and toggles the LED
  • Runs as a systemd service (Type=notify)
  • 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

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

Instala em /usr/local/:

  • /usr/local/bin/scrolllock-led-daemon
  • /etc/systemd/system/scrolllock-led-daemon.service
  • /usr/local/share/man/man8/scrolllock-led-daemon.8
  • /etc/udev/rules.d/99-scrolllock-led-daemon.rules
  • /usr/share/bash-completion/completions/scrolllock-led-daemon.bash
  • /etc/scrolllock-led-daemon.conf

Dependências

sudo apt install python3-evdev

Usage

Usage: scrolllock-led-daemon [OPTIONS]

Options:
  --device PATH     Keyboard device path (overrides auto-detection)
  --led PATH|NAME   LED brightness file or name (scrolllock, capslock, numlock)
  --key NAME        Key to listen for (default: KEY_SCROLLLOCK)
  --set on|off      Set LED state and exit (one-shot mode)
  --toggle          Toggle LED state and exit (one-shot mode)
  --list            List available input devices and exit
  --doctor          Run system diagnostics
  --config PATH     Path to configuration file
  --verbose         Enable debug logs
  --version         Show version
  --help            Show help

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

Run a system health check:

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.

Troubleshooting

Permission denied

If you see:

Permission denied while accessing /dev/input/event*

Run with sudo or install the udev rules:

sudo ./scripts/install.sh

The udev rules give your user access to input devices without root.

No keyboard found

If auto-detection fails, list available devices:

scrolllock-led-daemon --list

Then use the exact path:

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

Development

Dependencies

pip install ".[test]"

Tests

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

Syntax check

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

Uninstall

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.0.6.tar.gz (22.8 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.0.6-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scrolllock_led_daemon-1.0.6.tar.gz
  • Upload date:
  • Size: 22.8 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.0.6.tar.gz
Algorithm Hash digest
SHA256 7c5ed024db20b828a81d18193e86738a955cec06c6c8ff23dfac51cfd9468818
MD5 321938813926b1fbc7e033d4bd4e4ba0
BLAKE2b-256 e82c5374eba8601de28750043fd1098a3015ff128f375ef83b4d36f8986a168b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for scrolllock_led_daemon-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c3dfaf192435306abc367f543daaaee3e43c5f47b7764f0edacafdcfde6fcc3b
MD5 d2d731f0da01d8e3f0992d8fe2695f92
BLAKE2b-256 6a3ff256bde382aea59d0f8d853c231482c5dca2066e9d8ca54d5df82c8527f8

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