diff --git a/CHANGELOG.md b/CHANGELOG.md index 99b68aa64d..da777663fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Changes: * Redhat Virtio GPUs are now reported as integrated instead of discrete. (GPU, Linux) Bugfixes: +* Fixed the interactive config generator saving the small logo as a logo source. (#2758, Logo) * Fixed libc version detection on FreeBSD without binutils installed, and on DragonFly BSD. (Libc, FreeBSD / DragonFly) * Fixed CPU cache detection failing entirely when any CPU is offline. (#2736, CPUCache, Linux) * Fixed the scale factor of rotated monitors on Wayland, e.g. a 1920x1200 monitor rotated by 90 degrees at scale 1 being reported as `@ 1.59x`. (Display, Linux) diff --git a/src/fastfetch.c b/src/fastfetch.c index 7c3c45ce95..8f581892f7 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -868,8 +868,6 @@ static void writeConfigFile(FFdata* data) { } else if (data->genConfigInteractive) { if (instance.config.logo.type == FF_LOGO_TYPE_NONE) { yyjson_mut_obj_add_null(doc, root, "logo"); - } else if (instance.config.logo.type == FF_LOGO_TYPE_SMALL && instance.config.logo.position == FF_LOGO_POSITION_LEFT) { - yyjson_mut_obj_add_str(doc, root, "logo", "small"); } else if (instance.config.logo.position != FF_LOGO_POSITION_LEFT || instance.config.logo.type == FF_LOGO_TYPE_SMALL) { yyjson_mut_val* logo = yyjson_mut_obj(doc); if (instance.config.logo.type == FF_LOGO_TYPE_SMALL) { diff --git a/tests/genconfig.py b/tests/genconfig.py new file mode 100644 index 0000000000..aab1a90564 --- /dev/null +++ b/tests/genconfig.py @@ -0,0 +1,32 @@ +"""Run with python3 tests/genconfig.py /path/to/fastfetch (requires pexpect).""" + +import json +import os +import sys +import tempfile +from pathlib import Path + +import pexpect + + +def test_small_logo(binary, directory): + path = directory / "config.jsonc" + path.write_text("{}") + env = dict(os.environ, TERM="xterm-256color", XDG_CONFIG_HOME=str(directory)) + env.pop("NO_COLOR", None) + + with pexpect.spawn(binary, ["-c", "none", "--gen-config", str(path)], env=env, timeout=10) as child: + child.expect_exact("interactive config generator") + child.send("l") + child.expect_exact("interactive config generator") + child.send("s") + child.expect_exact("File exists. Overwrite?") + child.send("y") + child.expect(pexpect.EOF) + + assert json.loads(path.read_text())["logo"] == {"type": "small"} + + +if __name__ == "__main__": + with tempfile.TemporaryDirectory() as directory: + test_small_logo(sys.argv[1], Path(directory))