feat: a50 dock service

This commit is contained in:
2026-01-04 23:42:04 +01:00
parent 63a657fc84
commit 6cb301eb81
3 changed files with 66 additions and 21 deletions

View File

@@ -0,0 +1,13 @@
stdbuf -oL hexdump -v -e '32/2 "%x " "\n"' "$HID_DEVICE" | while read -r line; do
echo "$line"
if [[ $line =~ ^c02[[:space:]]4[[:space:]]13[[:space:]]([0-9a-f]+) ]]; then
power_state=${BASH_REMATCH[1]}
if [[ $power_state == "0" ]]; then
echo "power=on"
wpctl set-default "$(pw-cli info "$HEADSET_NAME" | head -n 1 | awk '{print $2}')"
else
echo "power=off"
wpctl set-default "$(pw-cli info "$SPEAKERS_NAME" | head -n 1 | awk '{print $2}')"
fi
fi
done