sharkdp / vivid

A themeable LS_COLORS generator with a rich filetype datebase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Standard location for vivid database: $XDG_DATA_HOME?

yochem opened this issue · comments

Hi!

I'm trying to install this on MacOS. I downloaded the darwin version from the release page. Then I moved vivid to /usr/local/bin/vivid and share/vivid to $XDG_DATA_HOME/vivid, which made sense to me because of the share in the original path, which is also in the default for $XDG_DATA_HOME: $HOME/.local/share. I then got this error:

Error: Could not find filetypes database. Make sure that it is located in a standard location. Alternatively, specify the path via the command-line or the VIVID_DATABASE environment variable.

Because the path was not like the two paths specified in the README (which I hadn't read before installing, whoops)

Make sure that you install the contents of the share/vivid folder at /usr/share/vivid or at $HOME/.config/vivid.

My question is, why is the it in /usr/share/ or $HOME/.config (aka xdg config) and not in /usr/share/ or $HOME/.local/share (aka xdg data)?

Thank you for the feedback.

My question is, why is the it in /usr/share/ or $HOME/.config (aka xdg config) and not in /usr/share/ or $HOME/.local/share (aka xdg data)?

In principle, I would say that these files are rather "config" files than other kind of "data" files. But I see your point.

Maybe the default files that come with vivid should be stored in /usr/share/ or $XDG_DATA_HOME, but the (additional) user-defined files should be in $XDG_CONFIG_HOME. What do you think?

Thanks for your quick reply!

Maybe the default files that come with vivid should be stored in /usr/share/ or $XDG_DATA_HOME, but the (additional) user-defined files should be in $XDG_CONFIG_HOME. What do you think?

This would be a nice way to organize the files. I think adding something along the lines of "Provided themes and filetypes can be found in XDG data directory (default: ~/.local/share/vivid). For user-defined files, XDG config directory (default: ~/.config/vivid) can be used." to the README would be clear enough for people.

Having two directories with themes and filetypes can cause problems though. For example, what should happen when both directories contain a theme file with the same name? And what should happen when both directories contain filetypes.yml?

I think the best way to deal with themes is to just search XDG_CONFIG_HOME first. This way, a user can tweak the themes without changing the original provided themes. Simply copy the files from XDG_DATA_HOME to XDG_CONFIG_HOME and change them.

What do you think about this problem? What is your preferred way of handling these problems?

This would be a nice way to organize the files. I think adding something along the lines of "Provided themes and filetypes can be found in XDG data directory (default: ~/.local/share/vivid). For user-defined files, XDG config directory (default: ~/.config/vivid) can be used." to the README would be clear enough for people.

👍

I think the best way to deal with themes is to just search XDG_CONFIG_HOME first. This way, a user can tweak the themes without changing the original provided themes. Simply copy the files from XDG_DATA_HOME to XDG_CONFIG_HOME and change them.

What do you think about this problem? What is your preferred way of handling these problems?

I agree. It seems like user config files should override the default. I think this is fine until someone wants to simply extend the default filetypes.yml config. It works fine by copying the system file and making the changes, but there is a problem when a new version comes a long with an updated filetypes.yml.

In this case, it would be better if there were some kind of extension or include-mechanism where users could depend on the system configuration but extend it. But maybe that's overthinking things for now.

closed via #40 and #43