elkowar/eww · error

The configuration file

Error message

The configuration file `{}` does not exist

What it means

EwwConfig::read_from_dir loads the eww configuration from the user's config directory. Before parsing, it checks that the main yuck file (usually eww.yuck) exists; if not, it bails with this error. Eww refuses to start without a main configuration file.

Solutions

  1. Create the config directory and a main eww.yuck file (`mkdir -p ~/.config/eww && touch ~/.config/eww/eww.yuck`)
  2. Copy one of eww's example configurations into the expected directory
  3. Pass --config <dir> pointing at the directory that actually contains eww.yuck
  4. Verify the expected path printed in the error message exists (`ls <path>`)

Example fix

// before
eww open bar   # fails: The configuration file `/home/user/.config/eww/eww.yuck` does not exist
// after
mkdir -p ~/.config/eww
printf '(defwindow bar :geometry (geometry :width "100%" :height "32"))' > ~/.config/eww/eww.yuck
eww open bar
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
const yuck = `${configDir}/eww.yuck`;
if (!fs.existsSync(yuck)) throw new Error(`Create config first: ${yuck} missing`);

Type guard

function hasEwwConfig(dir) { try { return fs.statSync(`${dir}/eww.yuck`).isFile(); } catch { return false; } }

Try / catch

try { execSync('eww open bar'); } catch (e) { if (String(e).includes('does not exist')) { console.error('No eww config found; create ~/.config/eww/eww.yuck'); } else { throw e; } }

Prevention

When it happens

Trigger: Running any eww command (e.g. `eww open`, `eww daemonize`) when the yuck file at eww_paths.get_yuck_path() (typically ~/.config/eww/eww.yuck) does not exist.

Common situations: Fresh install with no config created yet; misspelled config directory passed via --config; config lives in a legacy location after upgrading eww; file renamed or deleted.

Understand the failure class

Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.

Related errors


AI-assisted analysis of elkowar/eww@48f5aa8b37 (2026-09-08). Data as JSON: /api/errors/dc316807fa05824b. Report an issue: GitHub.

Appendix: source

Thrown at crates/eww/src/config/eww_config.rs:43

/// Eww configuration structure.
#[derive(Debug, Clone, Default)]
pub struct EwwConfig {
    widgets: HashMap<String, WidgetDefinition>,
    windows: HashMap<String, WindowDefinition>,
    initial_variables: HashMap<VarName, DynVal>,
    script_vars: HashMap<VarName, ScriptVarDefinition>,

    // map of variables to all pollvars which refer to them in their run-while-expression
    run_while_mentions: HashMap<VarName, Vec<VarName>>,
}

impl EwwConfig {
    /// Load an [`EwwConfig`] from the config dir of the given [`crate::EwwPaths`], reading the main config file.
    pub fn read_from_dir(files: &mut FileDatabase, eww_paths: &EwwPaths) -> Result<Self> {
        let yuck_path = eww_paths.get_yuck_path();
        if !yuck_path.exists() {
            bail!("The configuration file `{}` does not exist", yuck_path.display());
        }
        let config = Config::generate_from_main_file(files, yuck_path)?;

        // run some validations on the configuration
        let magic_globals: Vec<_> =
            inbuilt::INBUILT_VAR_NAMES.iter().chain(inbuilt::MAGIC_CONSTANT_NAMES).map(|x| VarName::from(*x)).collect();
        yuck::config::validate::validate(&config, magic_globals)?;

        for (name, def) in &config.widget_definitions {
            if widget_definitions::BUILTIN_WIDGET_NAMES.contains(&name.as_str()) {
                return Err(
                    DiagError(ValidationError::AccidentalBuiltinOverride(def.span, name.to_string()).to_diagnostic()).into()
                );
            }
        }

        let Config { widget_definitions, window_definitions, mut var_definitions, mut script_vars } = config;
        script_vars.extend(inbuilt::get_inbuilt_vars());

View on GitHub (pinned to 48f5aa8b37)