-
Notifications
You must be signed in to change notification settings - Fork 147
Auto detect light/dark mode, changing the theme accordingly #380
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
Conversation
|
Uhhh changes are good but please don't reformat the codebase 😭 |
| impl Default for TerminalTheme { | ||
| fn default() -> Self { | ||
| Self::Light | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think dark terminals are more popular so maybe setting this default to dark would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, I'll change that
sorry cargo fmt just kinda does that... |
| .help("Ask for input before exiting") | ||
| .switch() | ||
| .hide(); | ||
| let auto_detect_light_dark = long("auto-detect-light-dark") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in the wrong section (Note the comment above: "hidden")
| .hide(); | ||
| let auto_detect_light_dark = long("auto-detect-light-dark") | ||
| .help("Enables hyfetch to detect light/dark terminal background in runtime") | ||
| .argument("BOOL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be something like "AUTO_DETECT_BG"
https://docs.rs/bpaf/latest/bpaf/parsers/struct.NamedArg.html#method.argument
For
metavarvalue you should pick something short and descriptive about the parameter, usually in capital letters. For example for an abstract file parameter it could be"FILE", for a username -"USER", etc.
| // hidden | ||
| test_print, | ||
| ask_exit, | ||
| auto_detect_light_dark, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here... Wrong section.

Description
This adds the ability to detect terminal colors when
hyfetchis invoked, thereby adapting its themeRelevant Links
This partially resolves my issue
Screenshots
Screen.Recording.2025-01-10.at.23.06.14.mov
My new config
{ "preset": "transgender", "mode": "rgb", "auto_detect_light_dark": true, "lightness": 0.65, "color_align": { "mode": "horizontal" }, "backend": "fastfetch", "args": null, "distro": null, "pride_month_disable": false }If I have to write this in python, I'll scream (and then figure it out anyway)