CLI for managing colors and effects for CosmicByte Firefly keyboard.
This project was done by reverse engineering the firefly software on windows. On Windows, The packets were sniffed using WireShark while running the firefly GUI software. Then packets were analysed and the logic written in rust using rusb crate.
-
12 different Effects
- Setting loop/individual color of effects
-
7 different colors
-
Individual key paint
-
Brightness control (This can already be modified via keybind Fn + {up,down} arrow)
-
Speed control (This can already be modified via keybind Fn + {left,right} arrow)
- Requires user to have permission to access usb devices, otherwise sudo can be used (not recommended). Ref: this stackoverflow link
- git clone
- Run
cargo buildto build the binary - The executable will be present in
target/<build-type>/(e.g.target/debug/for a debug build ortarget/release/for a release build)
The CLI currently uses flags instead of subcommands.
Basic format:
Firefly-cli --effect <effect-name> [--colors <7 hex colors>] [--ci <0-7>]-
--effect,-eRequired. Selects the lighting effect. -
--colors,-cOptional. Comma-separated list of exactly 7 hex colors. Example:--colors "#ff0000,#00ff00,#ffff00,#0000ff,#00ffff,#ff00ff,#ffffff" -
--ciOptional. Selects which palette color to use for the effect.0to6picks one of the 7 colors7loops through all 7 colors Default value is7
If --colors is not provided, these 7 colors are used:
#ff0000, #00ff00, #ffff00, #0000ff, #00ffff, #ff00ff, #ffffff
staticbreathefadegetting-offlittle-starslaserwaveneonraindropripplewave2swirl
Solid color using the first palette entry:
Firefly-cli --effect static --ci 0Without lights:
Firefly-cli --effect getting-offStatic mode with color loop:
Firefly-cli --effect static --ci 7Breathing effect:
Firefly-cli --effect breatheFade effect:
Firefly-cli --effect fadeLittle stars effect:
Firefly-cli --effect little-starsLaser effect:
Firefly-cli --effect laserWave effect:
Firefly-cli --effect waveNeon effect:
Firefly-cli --effect neonRaindrop effect:
Firefly-cli --effect raindropRipple effect using the third palette color:
Firefly-cli --effect ripple --ci 2Wave2 effect:
Firefly-cli --effect wave2Swirl effect:
Firefly-cli --effect swirlCustom 7-color palette:
Firefly-cli --effect wave --colors "#ff0000,#00ff00,#ffff00,#0000ff,#00ffff,#ff00ff,#ffffff"Show built-in CLI help:
Firefly-cli --help--effectis required.--colorsmust contain exactly 7 valid 6-digit hex colors.--cimust be between0and7.- If USB permissions are not configured on Linux, the program may fail to access the keyboard.