Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/fastfetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
32 changes: 32 additions & 0 deletions tests/genconfig.py
Original file line number Diff line number Diff line change
@@ -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))