Failed Parsing Config

4 min read Original article ↗

Describe the bug
Config fails to read the syntax of the config file and doesn't work properly. Even though I copy the exact config syntaxing and all the rest of it, the default config file provided in /etc/gromit-mpx is the issue, it doesn't know what the config parse should be when reading the defaults.

Also displays error with:

Expected name of Tool to define or Hot key definition

To Reproduce

  1. Start Gromit-MPX without config
  2. Grab skeleton config from /etc/gromit-mpx
  3. Change nothing
  4. Start Gromit-MPX, get shown error Failed parsing config file /home/user/.config/gromit-mpx.cfg falling back to default tools.

Expected Behavior
Read config and just work

Screenshots

Environment (please complete the following information):

  • Gromit-MPX version: 1.6.0
  • Flatpak or Distribution-package or Built-from-source: tried both AUR & Git Source
  • OS and version: Manjaro Linux
  • Desktop Environment and version: Cinnamon
  • X11 or Wayland session: Xwayland

In a custom config I've tried the following; and Gromit-MPX fails to parse anything. The problem lies with the parsing, Gromit-MPX clearly needs to have it's syntax parsing checked and rebuilt if it can't read it's own syntax's for the config file because it's bugged if it's unable to read the default config file or a custom config file. I would just remake the syntax it reads for the file in a more easily readable format that it understands for typical config files. The documentation around it's details of the config file and syntaxes for this tool is really poorly underdocumented, and it's mostly guess work as to WHAT actually works and what doesn't, and the errors it produces aren't exactly helpful either, it can't even point out what lines are wrong and failing to parse at, and giving vague and impossible errors that don't mean anything or give any description of what the errors even means.

If you're given an error that states;

Expected name of Tool to define or Hot key definition

What does that message even suppose to mean to someone who's trying to configure it? This is where I would be considering putting helpful information about it, a support link or mention of something to put you in the right directly, this is just the example of what I mean about poor documentation here. Link to the Wiki page that details this information.

Other obscure errors that doesn't have any context to what it means;

WARNING: Unable to copy "red Pen|@0": not yet defined!

as an example of a misconfiguration, you might be given a warning message, but doesn't mention what it means by "not yet defined" this is where I would put extra notes showing how to define something in the config file.

For the Super-Obscure Error messages;
Expected ";"

Doesn't mention where it expects this ; character in the config, you need to specify what line it's failing and where it's expecting a certain character at on what line, instead of absolutely nothing to go on. LINE what on COLUMN what?

Proper Error messages for syntax errors would be like this;

Syntax error on line 13, column 17
Expected ";"
# GROMIT-MPX
workspace = special:gromit, gapsin:0, gapsout:0, on-created-empty: gromit-mpx -a
windowrule = noblur, ^(Gromit-mpx)$
windowrule = opacity 1 override, 1 override, ^(Gromit-mpx)$
windowrule = noshadow, ^(Gromit-mpx)$
windowrule = nofullscreenrequest, ^(Gromit-mpx)$
windowrule = size 100% 100%, ^(Gromit-mpx)$
bind = , F7, togglespecialworkspace, gromit
bind = SHIFT , F7, exec, gromit-mpx --clear
bind = , F6, exec, gromit-mpx --undo
bind = SHIFT , F6, exec, gromit-mpx --redo

# pen colors and style
"red Pen" = PEN        (size=3 color="#dc5644");
"blue Pen" = "red Pen"; (size=3 color="#6e89d5");
"yellow Pen" = "red Pen"; (size=3 color="#dfb063");
"green Pen" = "red Pen"; (size=3 color="#aed854");
"white Pen" = "red Pen"; (size=3 color="#ffffff");

# Line Tool
"green Line" = LINE; (minsize=3 color="#aed854");

# Rect Tool
"yellow Rectangle" = LINE; (minsize=3 color="#dfb063");

# Eraser
"Eraser" = ERASER (size=5);

# define device input
"Core Pointer"    = "red Pen";
"Core Pointer"[1] = "red Pen";
"Core Pointer"[2] = "blue Pen";
"Core Pointer"[3] = "green Pen";
"Core Pointer"[4] = "yellow Pen";
"Core Pointer"[5] = "white Pen";
"Core Pointer"[6] = "Eraser";