Replies: 3 comments 2 replies
-
Hi @danfe. Absolutely true. Currently loading everything from the user's directory. But both color schemes and plugins should be read first from the user's dir, and then from the corresponding system directory. Duplicates should be checked as well, and in case one is found, load it from the user's dir. This is a quite standard approach. I will implement it. Thanks! |
Beta Was this translation helpful? Give feedback.
-
One question: given the fact that PREFIX could be anything, how can I get the current one? Should I take it from the executable's path? This seems possible, but the executable could be moved to any other location not under PREFIX. |
Beta Was this translation helpful? Give feedback.
-
Well, it should be working now. I added checks for Regarding
I guess this should be enough. |
Beta Was this translation helpful? Give feedback.
-
Currently, CliFM attempts to load color schemes from the
COLORS_DIR
, which resolves to$(HOME)/.config/clifm/colors
. This is correct location to store user-modified data, but typically, system-wide directories (e.g.,/usr/local/share/clifm/colors
) should also be checked, when there is no user-provided file. This would allow to package extra color schemes, because right now, users are advised togit clone
and copy files toCOLORS_DIR
manually.At a quick glance, the following changes should be made to the code (just a rough quick'n'dirty sketch):
I've only tried loading the themes, and did not test how it behaves when trying to modify and save them; also, the proposed code does not check for duplicates. Alternatively,
COLORS_DIR
could be made a list of directories, not just one, but that might be more complicated approach (e.g., it would probably require tracking of each directory's writability).There is also an inconsistency: plugins and functions are installed into their dedicated subdirectories, but
default.cfm
ends up in$(PREFIX)/share/clifm
, that is, without thecolors
subdirectory.Beta Was this translation helpful? Give feedback.
All reactions