Files
acer-lighting-daemon/acer-rgb.sh
Fernando Crespo 4c1c7a5477 Implement Acer RGB control daemon and CLI
- Removed acer-rgb.cpp and replaced it with acer-rgb-cli.cpp for command-line interface functionality.
- Added acer-rgbd.cpp to implement a daemon that manages RGB settings for keyboard, lid, and button devices.
- Introduced a socket communication mechanism via acer-rgb.sh for sending commands to the daemon.
- Created service and socket files (acer-rgbd.service and acer-rgbd.socket) for systemd integration, allowing the daemon to run as a service.
- Implemented state persistence for RGB settings in /var/lib/acer-rgbd/state.txt, enabling restoration on boot.
2026-01-30 16:43:45 -03:00

19 lines
400 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SOCK="/run/acer-rgbd.sock"
if [[ $# -lt 1 ]]; then
echo "Usage:"
echo " acer-rgb GET"
echo " acer-rgb SET hidraw=/dev/hidraw2 dev=keyboard effect=static bright=80 r=255 g=0 b=0 zone=all"
exit 2
fi
cmd="$*"
if command -v socat >/dev/null 2>&1; then
printf "%s\n" "$cmd" | socat - UNIX-CONNECT:"$SOCK"
else
printf "%s\n" "$cmd" | nc -U "$SOCK"
fi