Skip to content

Instantly share code, notes, and snippets.

@keifgwinn
Created July 3, 2023 20:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keifgwinn/543d38bf287341ff239926397a5d84fc to your computer and use it in GitHub Desktop.
Save keifgwinn/543d38bf287341ff239926397a5d84fc to your computer and use it in GitHub Desktop.
Toggle Litra
#!/bin/bash
# Use 046D/C900 for older models
model="046D/C901"
# Change to your own path
hidapitester="/usr/local/bin/hidapitester"
beam="046D/C901"
glow="046D/C900"
if [[ ! -f ~/litratoggle ]]; then
eval "$hidapitester --vidpid $glow --open --length 20 --send-output 0x11,0xff,0x04,0x1c,0x01" && \
eval "$hidapitester --vidpid $beam --open --length 20 --send-output 0x11,0xff,0x04,0x1c,0x01"
touch ~/litratoggle
else
eval "$hidapitester --vidpid $glow --open --length 20 --send-output 0x11,0xff,0x04,0x1c" && \
eval "$hidapitester --vidpid $beam --open --length 20 --send-output 0x11,0xff,0x04,0x1c"
rm ~/litratoggle
fi Use 046D/C900 for older models
model="046D/C901"
# Change to your own path
hidapitester="/usr/local/bin/hidapitester"
beam="046D/C901"
glow="046D/C900"
if [[ ! -f ~/litratoggle ]]; then
eval "$hidapitester --vidpid $glow --open --length 20 --send-output 0x11,0xff,0x04,0x1c,0x01" && \
eval "$hidapitester --vidpid $beam --open --length 20 --send-output 0x11,0xff,0x04,0x1c,0x01"
touch ~/litratoggle
else
eval "$hidapitester --vidpid $glow --open --length 20 --send-output 0x11,0xff,0x04,0x1c" && \
eval "$hidapitester --vidpid $beam --open --length 20 --send-output 0x11,0xff,0x04,0x1c"
rm ~/litratoggle
fi
#!/bin/bash
if [[ -f ~/litratoggle ]]; then
# Use 046D/C900 for older models
model="046D/C901"
# Change to your own path
hidapitester="/usr/local/bin/hidapitester"
beam="046D/C901"
glow="046D/C900"
eval "$hidapitester --vidpid $glow --open --length 20 --send-output 0x11,0xff,0x04,0x1c" && \
eval "$hidapitester --vidpid $beam --open --length 20 --send-output 0x11,0xff,0x04,0x1c"
rm ~/litratoggle
fi
#!/bin/bash
if [[ ! -f ~/litratoggle ]]; then
# Use 046D/C900 for older models
model="046D/C901"
# Change to your own path
hidapitester="/usr/local/bin/hidapitester"
beam="046D/C901"
glow="046D/C900"
eval "$hidapitester --vidpid $glow --open --length 20 --send-output 0x11,0xff,0x04,0x1c,0x01" && \
eval "$hidapitester --vidpid $beam --open --length 20 --send-output 0x11,0xff,0x04,0x1c,0x01"
touch ~/litratoggle
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment