matryer/xbar · error

disabled

Error message

disabled

What it means

Returned by ItemParams.setValueByKey when the 'disabled' parameter value cannot be parsed as a boolean (parseBool fails). The parse error is wrapped with the key name, producing the message 'disabled: ...'. It surfaces while parsing plugin item parameter strings into an ItemParams struct.

Source

Thrown at pkg/plugins/item_params.go:183

		s = s[end+1:]
	}
}

// defaultParams are the default ItemParams.
var defaultParams = ItemParams{
	Dropdown: true,
	Trim:     true,
	Emojize:  true,
	ANSI:     true,
}

func (p *ItemParams) setValueByKey(key, value string) error {
	switch key {
	case "disabled":
		var err error
		p.Disabled, err = parseBool(value)
		if err != nil {
			return errors.Wrap(err, key)
		}
	case "key":
		p.Key = value
	case "href":
		p.Href = value
	case "color":
		var err error
		p.Color, err = parseColor(value)
		if err != nil {
			return errors.Wrap(err, key)
		}
	case "font":
		p.Font = value
	case "size":
		val, err := parseInt(value)
		if err != nil {
			return errors.Wrap(err, key)
		}

View on GitHub (pinned to d624239058)

Solutions

  1. Change the value to a boolean literal: disabled=true or disabled=false.
  2. Trim whitespace and remove surrounding quotes from the parameter value.
  3. Remove the 'disabled' key entirely if it should not be disabled.

Example fix

// before
disabled=yes
// after
disabled=false
Defensive patterns

Strategy: validation

Validate before calling

func validBoolParam(key, value string) error {
    if key == "disabled" {
        v := strings.TrimSpace(value)
        if v != "true" && v != "false" {
            return fmt.Errorf("disabled must be true/false, got %q", value)
        }
    }
    return nil
}

Try / catch

params, err := parseParamStr(raw)
if err != nil && strings.HasPrefix(err.Error(), "disabled:") {
    log.Printf("invalid 'disabled' value in %q, defaulting to false", raw)
    params.Disabled = false
}

Prevention

When it happens

Trigger: parseParamStr encounters key 'disabled' with a value not parseable by parseBool — e.g. 'disabled=yes', 'disabled=1 '? (whitespace), 'disabled=0x0', or an empty value where the parser expects true/false.

Common situations: Hand-edited plugin config files using YAML/JSON-style truthy values (yes/no/on/off) instead of true/false; trailing spaces or quotes around the value; copy-pasted config from another tool.

Related errors


AI-assisted analysis of matryer/xbar@d624239058 (2026-09-02). Data as JSON: /api/errors/900f8b8b6ba78bb4. Report an issue: GitHub.