Package: i3razer
i3 - razerVisualize hotkeys on a Razer keyboardA tool to show possible hotkeys or commands (e.g. i3 or vim commands) on a Razer keyboard with rgb lighting.
It is highly customizable: select which key is lit in which color on which action.
I encourage to write your own configuration to match your hotkeys.InstallationDisclaimerThis program only runs on Linux, depends on the linux openrazer client and X serverThe openrazer driver can be installed fromhere,
just select your OS and follow the instructions.To install i3razer run:$ pip install i3razerIf installed with privileged rights the executablei3razerwill already be in the path.
Otherwise it can be found in$HOME/.local/binUsage$ i3razer --config CONFIGThis runs i3razer with the given config file. Lookherefor the configuration.
If the config is not given theexamle_configwill be used.exec --no-startup-id i3razer --config CONFIGAdd this line to youri3-configto start the visualization on i3 startup.ContributeFind and report bugs ongithub.Map your LayoutRuni3razer --mapto map your keyboard Layout. Consider opening a pull request with the new Layout.Planned Featuresmodes can have a base mode to inherit from. Useful to combine modes, e.g. mode for num_lock on / off,
but still same commandsswitch mode stack: possibility to return to the previous mode and not to a defined mode (call stack instead of goto)dbus interface to change layout, current_mode, reload config and a program to connect to this interfaceConfigurationWith the configuration file the user can set the colors of keys and add keybindings to change the colors.
The file format is yaml. It consists of the sectionscolors,keys,color_schemes,modesSemantic Overview:Colors: define custom colors, e.g.my_red: '0xe01010'Keys: define set of keys for short access, e.g.numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9Color schemes: A color scheme specifies the look of the keyboard. Keys can be assigned to colors, or a color effect can be setModes: Modes define, when to show which color scheme. Color schemes can be shown, depending on which keys are pressed.
Modes can switch to another mode to change keys and color schemesExample ConfigColorsThecolorssets values to their color name.
The definition is justcolor_name: '0xrrggbb', wherecolor_ namecan be any value except starting with '0x'.
Make sure yaml interprets0xrrggbbas string.Default colors example:colors:black:'0x000000'red:'0xff0000'green:'0x00ff00'blue:'0x0000ff'KeysThekeyssection defines sets of keys.
When you have multiple color scheme which wants to set e.g. all numbers to the same color, the number keys can be predefined here.
The definition iskeyset_name: key_array. For the name all values can be used except the reserved ones.Reserved keyset namesall: Predefined keyset which contains all keys of the keyboardtype, name, default, inherit, switch_mode, scheme: These names have a predefined usage in the configuration.Key array definitionA keyarray defines multiple keys.key_nameorkeyset_namecan be included in an array:key1, keyset, key2The names are separated by ','. In a keyset definition newlines can be included.keys:prime_numbers:2, 3, 5, 7numbers:0, 1, 4, 6, 8, 9, prime_numbers# contains all numbers (0-9)arrows:up, left, down, rightnew_line:# newlines could improve readabilityshift_l,shift_r,control_l,control_rall:a# built in keyset, which has all keys of the keyboardColor SchemeA color scheme describes the look of the keyboard, which keys are lit in which color or what effect to play.
Which color scheme is drawn on the keyboard is determined in themodessection.
The default use case of a color scheme is to assign colors to keys:keys: color.
Keys is akey array(no newlines allowed) and color is either direct an hexstring '0xrrggbb'
of a color defined in thecolorssection.color_schemes:my_scheme:all:green# sets all keys to greennumbers:'0xffffff'# the number keys are whitew, a, s, d:redIf a key is present in multiple key arrays, the assigned color will be the one defined latest in the file.# this is directly the scheme definitionoverride_scheme:a:redall:black# overrides the previous definition for 'a' to be red and 'a' will be shown blackAdvanced color scheme configurationcolor scheme inheritanceandeffect definitionInheritanceMaybe multiple color schemes wants to set the same colors to many keys, as the schemes are very similar.
There is no need for a redundant color scheme definition,
as it is possible to inherit from another color scheme:inherit: color_scheme.
This adds the color information from the inherited scheme to this scheme.default:all:greenother_keys:yellowgaming:inherit:defaultw, a, s, d:redsome_scheme:numbers:orangeinherit:default# this overrides the numbers defined previouslyEffectTo show an effect on the keyboard a color schemetypemust be set:type: effect.
Possible types are:static, breath, reactive, ripple, spectrum, starlight, wave right, wave leftThestatictype is the default type and does not need to be specified. Each key can be assigned a static color.
All other types are keyboard build in effects, they can take a color or time, dependant on the keyboard or effect.
With these types (exceptstatic) inheritance is not possible,
as the definitions are quite simple and one could only inherit from the same type.
Colors of the effect are defined withcolor1: white, up to three colors can be specified.
If only one color is needed for the effectcolor: whitewill suffice.Colors per effect:EffectNumber of colorsbreathup to three colorsreactiveexactly one colorrippleup to one colorstarlightup to two colorsspectrum, wave {right / left}no colorIf no color is given the effect is always executed with a random colorEffect timesSome effects take a timing value:time: value. If no value is given, the default is used.EffectTime values, (default)Descriptionreactive'500', ('1000'), '1500', '2000'milliseconds the pressed key is litstarlightfast, (normal), slowspeed of starlight blinkingAll other effects have no time option.Exampleeffect_scheme:type:reactivecolor1:green# or just color: greentime:'1000'effect_stars:type:starlightcolor1:bluecolor2:greentime:slowModesA Mode defines which color scheme gets drawn on the keyboard. The scheme depends on the currently pressed keys.
Possible hotkeys can be visualized on the keyboard, e.g. if the super key is pressed.
However sometimes the available hotkeys change, depended on what you do on your computer.
Many modes can be defined with different keys to show color schemes, but there needs to be the starting modedefault.
Switching from one mode to another is done with hotkeys, defined in the mode.Each mode must have a default color scheme, which will be drawn if no key is pressed:scheme: default_scheme.
Displaying other color schemes is done by assigning them to hotkeys:key_combinations: color_scheme.Key CombinationsKey combinations are an array of combinations, delimited by ','.
A combination can be a single key, or multiple keys delimited by '+':key1 + key2Such a combination is pressed if all the keys in the combination are pressed.
The combination  withnothing:nothing + key1 + key2holds only if exactly key1 and key2 are pressed,
no other key is allowed to be pressed.If one of the combinations of the array is pressed, the whole combination array is fulfilled and the
corresponding action applied.
If multiple combination arrays have a matching combination, the value of array defined first gets applied.modes:default:# default mode must exist, this is the start modescheme:defaultsuper_l + shift_l:some_schemesuper_l:mod_scheme# also holds if super+shift is pressed, but is defined laternothing + control_r, numbers:scheme# more complicated combinationSwitch modesSwitching the mode gives a new default color scheme and new hotkeys. It is defined in a mode as follows:switch_mode:key_combinations:next_modeExamplemodes:default:scheme:color/defaultsuper_l:super_hotkeys# light key r# more hotkeysswitch_mode:nothing + super_l + r:mode/resizemode/resize:scheme:color/resize# no hotkeys to displayswitch_mode:nothing + escape, nothing + return:default# switch back to default mode with escape or returnExample configHere is the defaultconfig.yamlwhich hotkeys are based on the defaulti3configuration.