Created
December 31, 2025 18:52
-
-
Save statico/9cf09d31012b6436c4cbc17a4256d954 to your computer and use it in GitHub Desktop.
logitech litra snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function status() { | |
| result=$(/usr/local/bin/hidapitester --vidpid 046D/C900 --open --length 20 \ | |
| --send-output 0x11,0xff,0x04,0x01 --read-input --timeout 500 2>/dev/null) | |
| if echo "$result" | grep -q "11 FF 04 01 01"; then | |
| echo "on" | |
| else | |
| echo "off" | |
| fi | |
| } | |
| function is_connected() { | |
| if /usr/local/bin/hidapitester --vidpid 046D/C900 --open 2>&1 | grep -q "Closing device"; then | |
| echo "connected" | |
| return 0 | |
| else | |
| echo "disconnected" | |
| return 1 | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment