{"record":{"id":"dc316807fa05824b","repo":"elkowar/eww","slug":"the-configuration-file-does-not-exist","errorCode":null,"errorMessage":"The configuration file `{}` does not exist","messagePattern":"The configuration file `(.+?)` does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/eww/src/config/eww_config.rs","lineNumber":43,"sourceCode":"\n/// Eww configuration structure.\n#[derive(Debug, Clone, Default)]\npub struct EwwConfig {\n    widgets: HashMap<String, WidgetDefinition>,\n    windows: HashMap<String, WindowDefinition>,\n    initial_variables: HashMap<VarName, DynVal>,\n    script_vars: HashMap<VarName, ScriptVarDefinition>,\n\n    // map of variables to all pollvars which refer to them in their run-while-expression\n    run_while_mentions: HashMap<VarName, Vec<VarName>>,\n}\n\nimpl EwwConfig {\n    /// Load an [`EwwConfig`] from the config dir of the given [`crate::EwwPaths`], reading the main config file.\n    pub fn read_from_dir(files: &mut FileDatabase, eww_paths: &EwwPaths) -> Result<Self> {\n        let yuck_path = eww_paths.get_yuck_path();\n        if !yuck_path.exists() {\n            bail!(\"The configuration file `{}` does not exist\", yuck_path.display());\n        }\n        let config = Config::generate_from_main_file(files, yuck_path)?;\n\n        // run some validations on the configuration\n        let magic_globals: Vec<_> =\n            inbuilt::INBUILT_VAR_NAMES.iter().chain(inbuilt::MAGIC_CONSTANT_NAMES).map(|x| VarName::from(*x)).collect();\n        yuck::config::validate::validate(&config, magic_globals)?;\n\n        for (name, def) in &config.widget_definitions {\n            if widget_definitions::BUILTIN_WIDGET_NAMES.contains(&name.as_str()) {\n                return Err(\n                    DiagError(ValidationError::AccidentalBuiltinOverride(def.span, name.to_string()).to_diagnostic()).into()\n                );\n            }\n        }\n\n        let Config { widget_definitions, window_definitions, mut var_definitions, mut script_vars } = config;\n        script_vars.extend(inbuilt::get_inbuilt_vars());","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/elkowar/eww/blob/48f5aa8b379adf29da0b0bb9ca04164f65d8bdaa/crates/eww/src/config/eww_config.rs#L25-L61","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Create the config directory and a main eww.yuck file (`mkdir -p ~/.config/eww && touch ~/.config/eww/eww.yuck`)","Copy one of eww's example configurations into the expected directory","Pass --config <dir> pointing at the directory that actually contains eww.yuck","Verify the expected path printed in the error message exists (`ls <path>`)"],"exampleFix":"// before\neww open bar   # fails: The configuration file `/home/user/.config/eww/eww.yuck` does not exist\n// after\nmkdir -p ~/.config/eww\nprintf '(defwindow bar :geometry (geometry :width \"100%\" :height \"32\"))' > ~/.config/eww/eww.yuck\neww open bar","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst yuck = `${configDir}/eww.yuck`;\nif (!fs.existsSync(yuck)) throw new Error(`Create config first: ${yuck} missing`);","typeGuard":"function hasEwwConfig(dir) { try { return fs.statSync(`${dir}/eww.yuck`).isFile(); } catch { return false; } }","tryCatchPattern":"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; } }","preventionTips":["Always create eww.yuck in the config dir before running eww commands","Use `eww --config <dir>` only with directories containing eww.yuck","Keep configs under XDG_CONFIG_HOME/eww","Copy an example config when starting fresh"],"tags":["config","file-not-found","startup"],"backgroundTag":"config-file-not-found","analyzedSha":"48f5aa8b379adf29da0b0bb9ca04164f65d8bdaa","analyzedAt":"2026-09-08T03:13:26.897Z","contentChangedAt":"2026-09-08T03:13:26.897Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}