Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


A script to change the key colors on a Logitech G213 Prodigy Gaming Keyboard.

Please also check out these awesome forks:

G213Colors GUI - A cool grafical GUI you can use from the main menu

G213Colors GUI + installation script - The GUI plus an easy installation script

Thanks to derEisele and JeroenED for creating this!

What it does

G213Colors lets you set the color(s) and certain effects of the illuminated keys on a G213 keyboard under Linux.

The original Software and Hardware has the following downsides:

  • There is no Linux software
  • The keyboard does not save the last setting, one has to re-set it every bootup / disconnect
  • The keyboard starts up with an annoying color cycle animation
  • The original software is unusable with KVM switches

So i decided to reverse engineer their USB protocol and to write my own script to control the keyboard.

G213Colors was built and tested under Linux for the G213 keyboard specifically, but after some adaptation it could potentially be run under other OS'es and used for other Logitech keyboards as well. Please understand that i do not support any such adaptation, if you want to do it you are on your own.

The "Wave" color effect that is available with the Logitech software could not be replicated since it is completely generated in the software by updating the colors every x ms (In contrast to the other effects which run on the keyboard itself). You could generate this effect with a script, but since G213Colors has to detach the kernel driver from one of the G213's interfaces to send data out the multimedia keys would most likely stop working. Unfortunately this is a side effect of the linux driver structure.


Either download the file to a directory of your choosing or clone this project with git.


If you run the script as Root (Which is likely) please install the libraries also as root (E.g.: sudo pip3 install pyusb, sudo pip3 install randomcolor, use only "pip" for Python 2).

Please ignore the pcap directory, i added the pcap files i used for reverse engineering just in case someone wants to work with them. They can be opened with Wireshark.


For help on how to use G213Colors call the script without any arguments:

sudo python

G213Colors needs to run as root as long as your user doesn't have access privileges for that USB device (How to do this, please use "046d" as idVendor and "c336" as idProduct).

If you want to run the script when the keyboard is plugged in (For instance if you use a USB switch or KVM switch) use this udev rule (In this case the script is run by root):

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c336", RUN+="/usr/bin/python /usr/local/bin/ -c 4F7F9F"


Changelog v0.3:

  • Added feature: Assign random colors to keyboard by using -ra or -rs flag

Changelog v0.2:

  • Fixed bug preventing setting all 5 color fields correctly, thanks to @oncecreated for finding this solution!
  • Added propper validation of user inputs
  • Complete refactoring

Changelog v0.1:

  • Initial checkin


A Python script to change the key colors on a Logitech G213 Prodigy Gaming Keyboard








No packages published