bug: theme.yml doesn't work on macOS
Version: v0.20.7
I have a theme.yml in ~/.config/eza/theme.yml. The theming works on my linux machine - but not on macOS. I have set $XDG_CONFIG_HOME to $HOME/.config in my .zshenv.
I tried using iTerm2 and kitty and it doesn't work on either when using macOS. I also tried setting $EZA_CONFIG_DIR to ~/.config/eza which also didn`t resolve the issue.
For some reason I have not identified, I am running 0.20.3 and I have the same issue that ~/.config/eza/theme.yml is not being parsed on macOS. I do not have $XDG_CONFIG_HOME set.
Okay, if you set $EZA_CONFIG_DIR to /Users/<username>/.config/eza it works. PathBuf::from("~/...") does not resolve the ~, that is a shell function.
Now, as to why it doesn't even work when you just put it in ~/.config/eza/theme.yml is because on macOS dirs.config_dir() returns $HOME/Library/Application Support
Location: https://github.com/eza-community/eza/blob/29afcb50e0d16e87ac5fd0f70976231a92d80966/src/options/theme.rs#L47
What's worse is that even if you were to put your config in ~/Library/Application Support/eza/theme.yml it still doesn't work as if the theme comes from there it merely reads the default theme:
https://github.com/eza-community/eza/blob/29afcb50e0d16e87ac5fd0f70976231a92d80966/src/options/theme.rs#L50
I have also experienced this issue
Setting CONFIG_DIR to /Users/<username>/.config/eza Also worked for me. the comments are very vague and I thought you needed to set it to ...eza/theme.yml. it also doesn't take control of the directory or filename colours on Iterm for me. @kristof-mattei Did you have the same problem?
@brandon-1999 @kristof-mattei same here, while using the absolute path instead of '~' fixed the issue of not picking up the theme on MacOS, some elements of the theme have no effect/impact e.g. the directory and filename colours (all the filekinds theme overrides don't work really):
https://github.com/eza-community/eza-themes/blob/main/themes/tokyonight.yml#L3-L13 https://github.com/eza-community/eza/blob/v0.20.9/src/theme/default_theme.rs#L28
eza also cannot import configured themes on linux, even though I have set the EZA_CONFIG_DIR environment variable. But on Windows, this can be solved by setting the EZA_CONFIG_DIR environment variable.It is strongly recommended to add a config.toml configuration file like lsd, which can be customized. After all, some columns are not used on Windows. Although I have configured the theme and configuration file of lsd, lsd starts very slowly when importing the configuration and theme on Windows. Fortunately, the speed of Linux is OK; I hope eza can support customized configuration while starting quickly.
I am (was) having the same issue. Setting the full path for $EZA_CONFIG_DIR helped but a theme.yml in the folder is ignored. It was only after I created a theme.yml link in ~/Library/Application Support/eza (had to manually create eza dir) that things began working.
Here is what got me working:
My .zshrc:
EZA_CONFIG_DIR=/Users/<username>/.config/eza
XDG_CONFIG_HOME=/Users/<username>/.config
Theme repo is cloned into ~/.config/eza/ so things look like this:
❯ tree -d ~/.config/
/Users/<username>/.config/
├── eza
│ ├── eza-themes
│ │ ├── imgs
│ │ └── themes
│ ├── test_dir
│ │ └── src
│ └── themes
mkdir ~/Library/Application\ Support/eza
cd ~/Library/Application\ Support/eza
ln -sf $EZA_CONFIG_DIR/eza-themes/themes/tokyonight.yml ./theme.yml
Confirm:
eza -lh --icons $EZA_CONFIG_DIR/test_dir
Sadly, I only came across this discussion when I was a few hours into troubleshooting this. Thank you kristof-mattei for providing the piece that allowed for forward progress.
To test this, I created theme.yml (an actual file, not a symlink) in both these locations on macOS 15.5:
~/Library/Application\ Support/eza/theme.yml
~/.config/eza/theme.yml
Only the theme at ~/Library/Application\ Support/eza/theme.yml is picked up by eza 0.23.0, no matter what I put in the ENV variables.
EDIT: Interestingly, when I set the ENV variables to an invalid path (as I first accidentally did like this:)
export EZA_CONFIG_DIR=/Users/<username>/.config/eza/theme.yml
export XDG_CONFIG_HOME=/Users/<username>/.config/eza/theme.yml
then no theme is picked up at all. So the variables clearly do something, but even when set to the proper path, they don't have the desired effect.
Just chiming in. Appears I have the same issue happening. And no variation of above appears to be solving my issue for me. I can't get ANY theme.yml to be read.
This is with eza installed with homebrew, fwiw
Same here, doesn't seem to work on arch linux. Tried every single combination of $EZA_CONFIG_DIR I could think of
If someone using Linux has this problem where eza suddenly stops displaying colors, it may be a conflict with the LS_COLORS variable.
put in your .bashrc/zshrc
unset LS_COLORS