hykilpikonna / hyfetch

🏳️‍🌈 🏳️‍⚧️ Neofetch with LGBTQ+ pride flags!
MIT License
1.18k stars 93 forks source link

Wrong terminal font value #213

Closed EngineerDali closed 8 months ago

EngineerDali commented 8 months ago

Describe the bug

The value displayed by "term_font" is incorrect. As seen in the screenshot, it still shows the default one for XFCE.

Expected behavior

The correct font being displayed (shown on the right in the screenshot)

Screenshots

image

Config file

  1. Run cp ~/.config/neofetch/config.conf conf.txt
  2. Drag conf.txt here to upload it. conf.txt

Verbose log

  1. Run neofetch -vv 2> neofetch.log
  2. Drag neofetch.log here to upload it. neofetch.log
BKasin commented 8 months ago

The part that is failing is the block here:

https://github.com/hykilpikonna/hyfetch/blob/a1e42b4f891ee00d3adb8fafb39b6a9c435aba5b/neofetch#L4818-L4829C11

"xfce4-terminal")
    term_font="$(awk -F '=' '/^FontName/{a=$2}/^FontUseSystem=TRUE/{a=$0} END {print a}' \
        "${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc")"

    [[ "$term_font" == "FontUseSystem=TRUE" ]] && \
        term_font="$(gsettings get org.gnome.desktop.interface monospace-font-name)"

    term_font="$(trim_quotes "$term_font")"

    # Default fallback font hardcoded in terminal-preferences.c
    [[ -z "$term_font" ]] && term_font="Monospace 12"
;;

It's trying to read a config file that doesn't exist according to your log on line 1531, so neofetch is falling back to the default. I did some searching and found this reddit post saying that the config format was changed, and the new file is .config/xfce4/xfconf/xfce-perchannel-xml/xfce4-terminal.xml. So an update to that function will be required. I'm about to go to bed, but can work on it when I wake up.

BKasin commented 8 months ago

Sorry if I just spammed you with emails. Made a PR that will have neofetch check for the new config, try to parse that, and if that file isn't found will check for the old config. It seems to be working for me, but a second look would be appreciated before I merge it.

EngineerDali commented 8 months ago

Thanks, no worries! It works for me as well :)