Skip to content

Instantly share code, notes, and snippets.

@statico
Last active August 18, 2022 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statico/d6c44887d9dde439258a43c6c52a4aba to your computer and use it in GitHub Desktop.
Save statico/d6c44887d9dde439258a43c6c52a4aba to your computer and use it in GitHub Desktop.
Control Logitech Litra with Raycast
#!/usr/bin/env bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Logitech Litra Glow Light Off
# @raycast.mode silent
$HOME/bin/litra dark
#!/usr/bin/env bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Logitech Litra Glow Light On
# @raycast.mode silent
$HOME/bin/litra light
#!/usr/bin/env bash
set -eo pipefail
function _hid() {
# https://github.com/todbot/hidapitester
~/bin/hidapitester --vidpid 046D/C900 --open --length 20 --send-output $1
}
# 2/17/22 Litra Glow aliases from https://github.com/kharyam/litra-driver/issues/13
function light() {
_hid 0x11,0xff,0x04,0x1c,0x01
}
function dark() {
_hid 0x11,0xff,0x04,0x1c
}
# ~10%
function glow(){
_hid 0x11,0xff,0x04,0x4c,0x00,20
}
# ~20%
function dim(){
_hid 0x11,0xff,0x04,0x4c,0x00,50
}
# tweaking by hand - less than 50%
function normal() {
_hid 0x11,0xff,0x04,0x4c,0x00,70
}
# ~50%
function medium() {
_hid 0x11,0xff,0x04,0x4c,0x00,100
}
# 90%
function bright(){
_hid 0x11,0xff,0x04,0x4c,0x00,204
}
# 2700K
function warmest() {
_hid 0x11,0xff,0x04,0x9c,10,140
}
# 3200K
function warm() {
_hid 0x11,0xff,0x04,0x9c,12,128
}
# 6500K
function coldest() {
_hid 0x11,0xff,0x04,0x9c,25,100
}
$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment