LGUG2Z/komorebi · critical

there is no home directory

Error message

there is no home directory

What it means

komorebic resolves its configuration directory via the HOME_DIR lazy static: it honors KOMOREBI_CONFIG_HOME if set and valid, otherwise falls back to dirs::home_dir(). The 'there is no home directory' panic fires when KOMOREBI_CONFIG_HOME is unset (or points to a non-directory) AND the OS cannot supply a home directory.

Source

Thrown at komorebic/src/main.rs:70

use komorebi_client::DefaultLayout;
use komorebi_client::FocusFollowsMouseImplementation;
use komorebi_client::HidingBehaviour;
use komorebi_client::MoveBehaviour;
use komorebi_client::OperationBehaviour;
use komorebi_client::OperationDirection;
use komorebi_client::Rect;
use komorebi_client::Sizing;
use komorebi_client::SocketMessage;
use komorebi_client::StateQuery;
use komorebi_client::StaticConfig;
use komorebi_client::WindowKind;
use komorebi_client::splash::ValidationFeedback;

lazy_static! {
    static ref HAS_CUSTOM_CONFIG_HOME: AtomicBool = AtomicBool::new(false);
    static ref HOME_DIR: PathBuf = {
        std::env::var("KOMOREBI_CONFIG_HOME").map_or_else(
            |_| dirs::home_dir().expect("there is no home directory"),
            |home_path| {
                let home = home_path.replace_env();
                if home.as_path().is_dir() {
                    HAS_CUSTOM_CONFIG_HOME.store(true, Ordering::SeqCst);
                    home
                } else {
                    panic!(
                        "$Env:KOMOREBI_CONFIG_HOME is set to '{home_path}', which is not a valid directory",
                    );
                }
            },
        )
    };
    static ref DATA_DIR: PathBuf = dirs::data_local_dir()
        .expect("there is no local data directory")
        .join("komorebi");
    static ref WHKD_CONFIG_DIR: PathBuf = {
        std::env::var("WHKD_CONFIG_HOME").map_or_else(

View on GitHub (pinned to e0709f02bf)

Solutions

  1. Set KOMOREBI_CONFIG_HOME to an existing directory containing your komorebi.json
  2. Ensure USERPROFILE (Windows) or HOME is set in the environment running komorebic
  3. Create the home directory if it was removed (e.g. mkdir /home/user or restore the Windows profile)
  4. Run komorebic from a normal user shell rather than a system/service account

Example fix

// before: komorebic run (fails with no USERPROFILE)
komorebic run
// after
export KOMOREBI_CONFIG_HOME="$HOME/.config/komorebi"
komorebic run
Defensive patterns

Strategy: validation

Validate before calling

if !isset($_ENV['HOME']) && !isset($_ENV['USERPROFILE']) && getenv('KOMOREBI_CONFIG_HOME') === false) {
  throw new RuntimeException('Set KOMOREBI_CONFIG_HOME or a home dir before running komorebic');
}

Prevention

When it happens

Trigger: Running komorebic with KOMOREBI_CONFIG_HOME unset or pointing at a path that is not an existing directory, while dirs::home_dir() returns None (no HOME/USERPROFILE resolvable).

Common situations: Running komorebic from a service account or scheduled task with no USERPROFILE set; launching from a stripped environment (empty env); CI containers without a home dir; a typo in KOMOREBI_CONFIG_HOME making the fallback path run.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of LGUG2Z/komorebi@e0709f02bf (2026-09-06). Data as JSON: /api/errors/92df8f50c9cfbf1f. Report an issue: GitHub.