elkowar/eww · error
Configuration directory
Error message
Configuration directory {} does not exist What it means
EwwPaths::from_config_dir requires the given config directory to exist on disk. If the path does not exist, it bails with this error before canonicalizing or hashing the directory. This guards against silently operating on a nonexistent config.
Solutions
- Create the directory: `mkdir -p <path>` and add an eww.yuck file
- Correct the --config argument / fix XDG_CONFIG_HOME or HOME so it points where the config actually lives
- Log or print config_dir in wrappers to see what path eww is actually resolving
- Run `eww state`/inspect EwwPaths default logic to confirm which directory is being used
Example fix
// before eww --config ~/.config/ewww open bar # typo: ewww // after eww --config ~/.config/eww open bar
Defensive patterns
Strategy: validation
Validate before calling
const fs = require('fs');
if (!fs.existsSync(configDir)) fs.mkdirSync(configDir, { recursive: true }); Type guard
function dirExists(p) { try { return fs.statSync(p).isDirectory(); } catch { return false; } } Try / catch
try { ewwPaths(configDir); } catch (e) { if (String(e).includes('does not exist')) { fs.mkdirSync(configDir, { recursive: true }); ewwPaths(configDir); } else { throw e; } } Prevention
- Create the config directory before invoking eww
- Double-check --config spellings
- Verify HOME/XDG_CONFIG_HOME in systemd/autostart environments
- Bootstrap configs with eww's example setup on new machines
When it happens
Trigger: Calling EwwPaths::from_config_dir (via --config or the default config location lookup) with a directory path that does not exist — typo'd path, wrong home dir, or config never created.
Common situations: Typo in --config argument; running eww under systemd/wayland with a different HOME than expected; fresh machine without eww config; XDG_CONFIG_HOME pointing somewhere unusual.
Related errors
- Please provide the path to the config directory, not a file…
- The configuration file
- Encountered both an SCSS and CSS file. Only one of these…
AI-assisted analysis of elkowar/eww@48f5aa8b37 (2026-09-08).
Data as JSON: /api/errors/39824c44fdcb6945.
Report an issue: GitHub.
Appendix: source
Thrown at crates/eww/src/paths.rs:26
/// Stores references to all the paths relevant to eww, and abstracts access to these files and directories
#[derive(Debug, Clone)]
pub struct EwwPaths {
pub log_file: PathBuf,
pub log_dir: PathBuf,
pub ipc_socket_file: PathBuf,
pub config_dir: PathBuf,
}
impl EwwPaths {
pub fn from_config_dir<P: AsRef<Path>>(config_dir: P) -> Result<Self> {
let config_dir = config_dir.as_ref();
if config_dir.is_file() {
bail!("Please provide the path to the config directory, not a file within it")
}
if !config_dir.exists() {
bail!("Configuration directory {} does not exist", config_dir.display());
}
let config_dir = config_dir.canonicalize()?;
let mut hasher = DefaultHasher::new();
format!("{}", config_dir.display()).hash(&mut hasher);
// daemon_id is a hash of the config dir path to ensure that, given a normal XDG_RUNTIME_DIR,
// the absolute path to the socket stays under the 108 bytes limit. (see #387, man 7 unix)
let daemon_id = format!("{:x}", hasher.finish());
let ipc_socket_file = std::env::var("XDG_RUNTIME_DIR")
.map(std::path::PathBuf::from)
.unwrap_or_else(|_| std::path::PathBuf::from("/tmp"))
.join(format!("eww-server_{}", daemon_id));
// 100 as the limit isn't quite 108 everywhere (i.e 104 on BSD or mac)
if format!("{}", ipc_socket_file.display()).len() > 100 {
log::warn!("The IPC socket file's absolute path exceeds 100 bytes, the socket may fail to create.");View on GitHub (pinned to 48f5aa8b37)