Files
nixos/Droidnix/generated/.config/scripts/numlock-check.sh
T
2026-04-28 13:10:57 +02:00

16 lines
493 B
Bash
Executable File

#!/usr/bin/env bash
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
# Tel toetsenborden met volledige toetsset (geen media-only apparaten)
COUNT=$(libinput list-devices 2>/dev/null \
| grep -A5 "Keyboard" \
| grep -c "kbd")
# Of via xinput / /proc alternatief:
# COUNT=$(cat /proc/bus/input/devices | grep -B5 'KEY=.*[a-f0-9]\{10\}' | grep -c 'Name=')
if [ "$COUNT" -ge 2 ]; then
numlockx on
else
numlockx off
fi