Skip to content
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

Highlightings doesn't render when using --load-config #517

Closed
EliasLucky opened this issue Aug 11, 2023 · 5 comments
Closed

Highlightings doesn't render when using --load-config #517

EliasLucky opened this issue Aug 11, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@EliasLucky
Copy link

EliasLucky commented Aug 11, 2023

General description of bug:

I have multiple config files in my $HOME/.config/fastfetch/ directory, and I want to load these different config files by using --load-config.

But I've noticed that if in $HOME/.config/fastfetch/ directory, there is config.conf or config.jsonc file when trying to use --load-config. File config.conf/config.jsonc will be loaded first, only after config.conf/config.jsonc file was loaded, will be loaded config file that was set when using --load-config.

Which causes issues with color, highlights and with --set-keyless variables, when multiple variables with the same name exists in config.conf and in config file that user trying to use when passing --load-config argument.

The same thing for using config files from "/usr/local/share/fastfetch/presets", config.conf file being loaded first, and only then config that was set when passing argument --load-config will be loaded, with issues.

The same thing for using config files from "/usr/local/share/fastfetch/presets", config.conf file is loaded first, and only then config from fastfetch presets will be loaded that user set when passing argument --load-config, with issues.

So i think the only solution is just to ignore "$HOME/.config/fastfetch/config.conf" and "$HOME/.config/fastfetch/config.jsonc" and $HOME/.config/fastfetch/config.conf" file when using argument --load-config, and load only config that was set when passing --load-config argument.

That's probably will be better than removing config.conf and using env NO_CONFIG=1 before using fastfetch with passing --load-config argument, I think.

  • What happened: Have "$HOME/.config/fastfetch/config.conf" file, trying to pass fastfetch --load-config small.conf causes issues with color highlights (all color highlights are white), because "config.conf" file loads first, and only after "config.conf" being loaded "small.conf"
  • What should happen: "config.conf" file should be ignored, and "small.conf" should be loaded first. (config that was set when trying to pass --load-config argument should be loaded first)
  • Did it work in an older version: no, I've seen old post about this issue, so I think this issue is still persists, and still not fixed.
  • Where did you get the binary: Github dev branch
  • Does this issue still occurs in the latest dev build? yes

I've also seen this post 377 about this issue, so I hope this will be helpful.

Often helpful information:

Output of fastfetch --version:

fastfetch 1.12.2-457 (x86_64)

The content of the configuration file you use (if any)
(small.conf)

--logo arch_small
--logo-color-1 blue

--color blue
--separator ": "

--set-keyless Start=┌───────────────────────────────┐
--set-keyless End=└───────────────────────────────┘

--os-key "|  OS"
--host-key "|  Host"
--kernel-key "|  Kernel"
--uptime-key "|  Uptime"
--packages-key "|  Packages"
--shell-key "|  Shell"
--wm-key "|  WM"

--structure Title:Start:OS:Host:Kernel:Uptime:Packages:Shell:WM:End

(config.conf):
Actually it looks the same as small.conf but with some differences with --set-keyless and that instead of arch_small there is default arch logo

--logo arch
--logo-color-1 blue
--logo-color-2 blue

--color blue
--separator ": "

--set-keyless Monoline="""""""""""

--set-keyless Software=┌───────── \e[1mSoftware Information \e[0m─────────
--set-keyless Hardware=├───────── \e[1mHardware Information \e[0m─────────
--set-keyless End=└────────────────────────────────────────

--os-key "| OS"
--host-key "| Host"
--kernel-key "| Kernel"
--uptime-key "| Uptime"
--packages-key "| Packages"
--shell-key "| Shell"
--wm-key "| WM"

--gpu-key "| GPU0"
--cpu-key "| CPU"
--memory-key "| Memory"
--terminal-key "| Terminal"
--theme-key "| Theme"
--display-key "| Display (VGA1)"
--locale-key "| Locale"

--structure Title:Monoline:Software:OS:Kernel:Packages:Shell:WM:Terminal:Theme:Hardware:Host:Display:CPU:GPU:Memory:End

Output of fastfetch --list-features:

threads
libpci
vulkan
wayland
xcb-randr
xcb
xrandr
x11
gio
dconf
dbus
zlib
xfconf
sqlite3
egl
glx
osmesa
libpulse
libnm
  • Does sleep 1 before running fastfetch work? no

PS: Hope this will be helpful!

@EliasLucky EliasLucky added the bug Something isn't working label Aug 11, 2023
@EliasLucky EliasLucky changed the title Highlightings doesn't render when using --load-config (Know the solution) Highlightings doesn't render when using --load-config Aug 11, 2023
@CarterLi
Copy link
Member

The problem is that the command line flags are always parsed and loaded after other config files being loaded, because we need the command line flags to override other flags set before. That's also the same reason why an strange environment variable NO_CONFIG is introduced instead of using command line flag --no-config

Did it work in an older version: no, I've seen old https://github.com/fastfetch-cli/fastfetch/issues/377about this issue, so I think this issue is still persists, and still not fixed.

Oh, that explains why I can't reproduce the issue.

@EliasLucky
Copy link
Author

EliasLucky commented Aug 11, 2023

Oh okay, that's explains a lot. So I think the current solution (for me atleast lol) just to rename config.conf file to something else for not being loaded, and load custom config files by using --load-config without any issues.

Anyways, glad to hear that my post was helpful, and now you can reproduce the issue! Goodluck in development!

@CarterLi
Copy link
Member

Does env NO_CONFIG=1 fastfetch --load-config your_config work?

@EliasLucky
Copy link
Author

EliasLucky commented Aug 11, 2023

Well yes, config.conf file doesn't being loaded first, and only my config file that I've set in --load-config being loaded.

So I think the current best way, is just to put env NO_CONFIG=1 before fastfetch, instead of renaming/removing config.conf file?

@CarterLi
Copy link
Member

Please test the latest dev build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants