-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config file for theming/customization💄 #745
Comments
Great idea! Do you think we should support the option for per-repo config files, too (I'm leaning towards no, but just want to put it out there)? I did something similar in my (unfinished 🤣) project repofetch in case you want to reference something. What format do you think it should be? I like YAML for human-editable files, but TOML, INI, and JSON also have some pros and cons. Or do we go the extra mile and support multiple formats? A cli option to print the location of the config file can also be useful, as well as an option to provide a different path to the config file. |
Thanks 😊
The format is still up for discussion, as you mentioned YAML and TOML seem more human-readible/editable. I like TOML because it allows for sections (maybe YAML does too 🤔), which makes it easier to organize/parse the entries by category, smth like: [general]
spacing = 2
padding = 0
separator = "->"
[palette]
glyph = "o"
[info]
size= "🖴"
Good idea, your second suggestion would be very useful 👍 |
🤔 Yeah in YAML I think it would just be general:
spacing: 2
padding: 0
# etc. Now I'm leaning more towards TOML, since it provides the user with more freedom in how they choose to format. # they can do this
[general]
spacing = 2
# or this
general = { spacing = 2 } We might want to get some metrics to figure out the most popular format, maybe even just by searching Although one other config format I've seen tools use is basically to make a 1:1 of the CLI without any nesting, where basically # flag in CLI
email=true
# option in CLI
true-color=never IMO regardless of the format, it would be great to make it possible for a user to understand the config just by using onefetch, without needing to go on the web to reference any docs. I guess we can add it to a man page, but we can also generate a default config with all options for the user to edit, or have a CLI tool like |
🤔 Now that I think about it, implementing For config paths, there's |
Good point!
But we can already start with what we have and add more options later on. |
I needed to double-check since it's been a while since I've used this Rust feature, but destructuring could make this really easy to implement. Might be worth making this a hacktoberfest issue 🎃 |
Hello! I'd like to take this issue as part of Hacktoberfest 🙂 One solution for making the config easily understandable for the user would be to generate the config if it doesn't exist, populating it with default options, and make sure it has comments that help understanding. Then the simplest option to reset the config to defaults would be just to delete/move the config file, as it would be recreated on the next startup. |
Just want to throw this out there: If rust-cli/config-rs#328 is implemented, then |
Just want to mention this, even though I'm not sure if it's a good idea. Assuming onefetch is always a Git repo tool (Maybe not?: #860), we could potentially take advantage of git configs. For a user, example usage would be like this: git config --global onefetch.image-path /home/me/Pictures/profile-pic.png
cd my-repo
git config --local onefetch.image-path assets/logo.png
# onefetch now "magically" shows the logo when run my-repo, and the profile pic in any other repo |
Reviewing old issues in this project... Yet another format, and possibly the easiest to implement, would be a simple options list. If you look at the Ruby ecosystem, with files like --image profile-pic.png
--exclude dist
--disabled-fields churn We shouldn't have to do much more than split this file into a |
Summary 💡
What about having a configuration file in which you could customize visual aspects of onefetch? for example:
General options:
--text-colors
)Palette:
Info lines:
The configuration file could be placed in
${HOME}/.config/onefetch/config.conf
(which format? YAML? TOML?)As suggested by @spenserblack
Motivation 🔦
Allow users to customize the look and feel of onefetch by creating themes and config files that can be shared and enjoyed by others.
For reference --> https://github.com/Chick2D/neofetch-themes
and https://github.com/spenserblack/repofetch (for an example of implementation)
The text was updated successfully, but these errors were encountered: