Buttons, layout, and other behavior are configured with the config.json
file.
The cost of high customizability is unfortunately high complexity. The configuration documentation here is for reference, but it is strongly recommended that you just start with the default config and modify it as you go, rather than starting from scratch.
You can use the Config Validator to verify your configuration changes.
The top level configuration object has the following keys:
Key | Type | Description |
---|---|---|
cncjs | Object | Connection information |
ui | Object | Global grid size and default colors |
streamdeckUi | Object | Stream Deck-only overrides to ui |
buttons | Object | Button display and actions |
scenes | Object | Button layout on individual pages |
machine | Object | Machine axes and per-axis speed modifiers |
cncjs
Used to configure connection to the cncjs server, and controller serial port
example
{
"cncjs": {
"accessTokenExpiration": "30d",
"baudRate": 115200,
"controllerType": "Grbl",
"port": "/dev/ttyACM0",
"socketAddress": "localhost",
"socketPort": 8000
}
}
Key | Type | Description |
---|---|---|
accessTokenExpiration | String , Integer | Web token expiration duration, in seconds or as a duration string. Default: 30d . Stream Deck only |
baudRate | Integer | Serial connection baud rate |
port | String | Serial connection port |
controllerType | Enum | Controller type. Allowed: [Grbl ] |
socketAddress | String | URL for socket connection to cncjs. Usually localhost |
socketPort | Integer | Socket connection port for cncjs. Usually 80 or 8000 |
secure | Boolean | If enabled, socket connections will be made over wss, and API requests over https. Default false |
machine
Machine axes and per-axis speed modifiers
{
"machine": {
"axes": ["x", "y", "z"],
"axisSpeeds": {
"x": 1,
"y": 1,
"z": 0.25
}
}
}
Key | Type | Description |
---|---|---|
axes | String[] | Array of axes in use. Allowed values: [a ,b ,c ,x ,y ,z ] |
axisSpeeds | Object | Per-axis speed overrides, used for smooth jogging |
machine/axisSpeeds
Override smooth jog speeds on a per-axis basis. Allows moving specific axes slower or faster than the current smooth jog travel speed.
Key | Type | Description |
---|---|---|
a | Number | Travel speed multiplier for the A axis. Default: 1 |
b | Number | Travel speed multiplier for the B axis. Default: 1 |
c | Number | Travel speed multiplier for the C axis. Default: 1 |
x | Number | Travel speed multiplier for the X axis. Default: 1 |
y | Number | Travel speed multiplier for the Y axis. Default: 1 |
z | Number | Travel speed multiplier for the Z axis. Default: 1 |
ui
Configuration for global interface settings.
{
"ui": {
"bgColor": 0,
"brightness": 60,
"columns": 5,
"font": "monospace",
"fontSize": 16,
"lineHeight": 1.2,
"gcodeColors": {
"G0": "#52ff2e",
"G1": "#9a96ff",
"G2G3": "#9a96ff"
},
"lineHeight": 1.1,
"palette": [
"#181818",
"#bdc3c7",
"#b71138",
"#efa021",
"#06D6A0",
"#2a88c5",
"#EF476F",
"#02535e",
"#1F2D3A"
],
"pageColor": 0,
"progressColor": 3,
"rows": 3,
"textColor": "#fff",
"textSize": 1.2,
"timeout": 180
}
}
Key | Type | Description |
---|---|---|
bgColor | Integer , String | Default background color for buttons. May be a color string or palette index |
brightness | Integer | Default brightness. [10 – 100 ] Stream Deck only |
columns | Integer | Number of columns to display |
rows | Integer | Number of rows to display |
font | String | Font to use for text display. Default: monospace |
fontSize | Number | Font size to use for text display Stream Deck only |
lineHeight | String | Line height for text display as a percentage of font size. Default: 1.1 |
gcodeColors | Object | Line and curve colors for gcode rendering. |
gcodeLimit | Integer | Set a hard limit on the number of lines of gcode that will be processed. Affects rendering and boundary data. Stream Deck only |
pageColor | Integer , String | Color to use for page background web only |
palette | String[] | Array of colors that buttons and other color settings may refer to by index |
progressColor | Integer , String | Color to use for button hold indicator. May be a color string or palette index |
textColor | Integer , String | Color to use for button text. May be a color string or palette index |
textSize | Number | Font size modifier. Default: 1 . web only |
throttle | Integer | Redraw each button at most once every throttle milliseconds. Default: 0 . Stream Deck only |
timeout | Integer | Duration, in seconds, before blanking display. Stream Deck only |
ui/gcodeColors
Gcode preview can use different colors for rapid travel, straight and curved cuts. Colors may use rgb(0, 50, 200)
,
hex #001122
etc. Palette colors are not supported here.
Key | Type | Description |
---|---|---|
G0 | String | Color to use for rapid travel moves. |
G1 | String | Color to use for straight line cut moves |
G2G3 | String | Color to use for curve cut moves |
The following variables are available to button conditions (like if
and disabled
), and templated text.
ui/palette
Palette colors are an array of color strings (of any length). You can refer to these colors in most places that expect a color by referencing their array index.
This helps keep your color choices consistent, and allows changing many colors at once if needed.
example
{
"palette": [
"#ccc",
"rgb(0, 100, 255)",
"salmon"
]
}
scenes
The scenes configuration controls the layout of buttons (from the buttons
object), and is used to
create individual pages. A scene represents a single page of visible buttons. It must have a unique name, so that it
can be referred to by button actions for navigation.
example
{
"scenes": {
"myScene": {
"buttons": [
["row1_button", null, null, "row1_button"],
[],
["row3_button"]
]
}
}
}
Key | Type | Description |
---|---|---|
<unique scene name> | Object | A named scene |
scenes/<unique scene name>
Individual scenes contain a single key: buttons
.
Key | Type | Description |
---|---|---|
buttons | (String, Null)[][] | Nested array of buttons |
The buttons
value is a nested array of button IDs, with each inner array representing a row of buttons.
null
values represent an empty space, and can be used in place of button IDs to space later buttons in the row.
Scenes should not contain more than the configured row or column count, and this behavior is considered undefined. However, scenes can have fewer items than the row or column.
The following would display eight buttons in a 3x3 grid, with the center square empty.
example
{
"buttons": [
["b1", "b2", "b3"],
["b4", null, "b5"],
["b6", "b7", "b8"]
]
}
Instead of a button ID, another nested array (containing button IDs) can be used in a row. In this case, only the last visible button in the array will be displayed. This is useful for making toggle buttons (technically two different buttons), or other conditional buttons that occupy the same space.
example
{
"buttons": [
[
"row1_button",
[
"conditional_button1",
"conditional_button2"
]
],
["row2_button"],
["row3_button"]
]
}
Several scenes have special meaning:
home
scene must exist, as it is used when the webpage or process first loads.numpad
scene must exist if any buttons use the enterWcs
or enterPosition
button actions.gcodeList
scene should not exist in your scenes list, but is always available for navigation events anyway.The file list scene layout is not configurable, since it is dynamically generated. However, the buttons used in this scene can have their appearance customized.
It is recommended that configuration of these buttons be limited background color and image only.
Key | Description |
---|---|
fileListFile | GCode file button |
fileListFolder | Subfolder button |
fileListPreviousFolder | “Up a directory” button |
fileListDownArrow | Down arrow for scrolling when the file list overflows the grid layout |
fileListUpArrow | Up arrow for scrolling when the file list overflows the grid layout |
sortScene | Button that links to a scene where file sort options can be selected |
streamdeckUi
This section has the exact same structure as the ui
configuration. Properties in streamdeckUi
will override those of the ui
section, when using a Stream Deck, and are ignored in the web version.
This allows the use of smaller fonts, brighter colors, or more aggressive throttling/rendering limits.
All properties are optional.
buttons
The buttons
configuration defines buttons, their appearance details, and what (if anything) happens when buttons are
pressed, released or held. Scenes
will refer to these buttons by their unique ID to display them their
layout.
example
{
"buttons": {
"my_button": {
"bgColor": "#ffccaa",
"icon": "custom/my_icon.png",
"text": "Oh no!",
"textAlignment": "top right",
"actions": [
{
"action": "navigate",
"arguments": ["home"],
"event": "hold"
}
]
}
}
}
Key | Type | Description |
---|---|---|
<unique button id> | Object | A named button |
buttons/<unique button name>
Key | Type | Description |
---|---|---|
actions | Object[] | Actions to take when button is pressed, released or held |
bgColor | Integer , String | Background color. May be a color string or palette index |
columns | Integer | Number of columns the button will occupy. Default: 1 |
rows | Integer | Number of rows the button will occupy. Default: 1 |
type | Enum | Changes the button’s behavior and appearance. Allowed: [gcodePreview ] |
icon | String | Image path to display, relative to public directory. Image will be shown over background, and behind text. |
if | String | Condition used for hiding and showing the button. See: conditions |
disabled | String | Condition used for disabling and enabling the button. See: conditions |
text | String | Text or text template that to be displayed on the button. See: templates |
textAlignment | Enum | Text position within the button. Allowed: [top left , top center , top right , left ,center ,right ,bottom left ,bottom center ,bottom right ] |
textSize | Number | Font size modifier. Default: 1 |
button/actions
A button’s actions
value defines what happens when a button is activated. Buttons can take multiple actions when
pressed, or when released, or when held down for a few moments, or a combination of those.
When a hold
action is defined, any following up
action will be skipped. This allows buttons to perform an action
when pressed briefly, and perform a different action if pressed for a longer period, exclusively.
Key | Type | Description |
---|---|---|
action | String | The name of an action which will be triggered based on the event . See: actions |
event | Enum | When the action will take place. Allowed: [up ,down ,hold ]. Default: down |
arguments | String[] | Options passed to the event. See: actions for specific arguments for each event |