Appendix B: Environment Variables

hande relies on two environment variables from your shell: one it defines itself, and one it simply depends on like any other program.

$HANDE_HOME

This is where hande keeps everything — its configuration file and every category file. If $HANDE_HOME isn’t set, hande defaults to ~/.hande.

To use somewhere else instead, set it in your shell’s own startup file, before hande is ever run from that shell. For ~/.bashrc or ~/.zshrc:

export HANDE_HOME="$HOME/.config/hande"

Anything you write here is expanded exactly as your shell would expand it — ~, $HOME, and any other environment variable are all resolved before hande uses it. This is what lets you follow the XDG Base Directory convention if you’d rather hande’s files sat under $XDG_CONFIG_HOME than in a dotfile of their own:

export HANDE_HOME="$XDG_CONFIG_HOME/hande"

Keep in mind that $XDG_CONFIG_HOME itself isn’t guaranteed to be set on every system — it defaults to ~/.config when it isn’t, but an unset variable expands to nothing at all, not to that default, so setting $HANDE_HOME this way is only reliable once $XDG_CONFIG_HOME is itself set (most desktop Linux distributions set it for you; if yours doesn’t, set both).

Once $HANDE_HOME is exported, open a fresh shell (or source the file you edited) before running hande again, so the new value actually takes effect.

$PATH

hande doesn’t define this one — it’s the ordinary shell variable every program relies on to find other programs by name — but two things worth knowing tie directly back to it:

  • hande itself needs to be somewhere on your $PATH for you to run it by typing just hande, the way every example in this manual does. If you installed it somewhere your shell doesn’t already search — ~/.cargo/bin, or a folder of your own — add that directory to $PATH in the same startup file as above:

    export PATH="$HOME/.cargo/bin:$PATH"
  • Every handler — the browser, file manager, editor, or anything else named in a bookmark or in the configuration file (see Chapter 3 and Chapter 7) — is looked up on $PATH the same way. This is exactly what’s behind the “not found in your PATH environment” message if you ever see it: hande looked for that program everywhere $PATH told it to look, and came up empty. Either the program isn’t installed, or it’s installed somewhere $PATH doesn’t cover — in which case adding that location to $PATH, the same way as above, fixes it for every handler at once, not just hande itself.