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

[BUG] preciseRefreshRate value ignored when using custom format #1211

Closed
mathgeniuszach opened this issue Aug 25, 2024 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@mathgeniuszach
Copy link

mathgeniuszach commented Aug 25, 2024

General description of bug:

  • What happened: When using a type "display" module and setting a custom format including {3} (refresh rate), the refresh rate is printed with full precision while preciseRefreshRate is set to false.
  • What should happen: The refresh rate should take into account preciseRefreshRate and round to the nearest integer like normal even when a custom format is set.
  • Fastfetch version used: 2.20.0
  • Did it work in an older version: no
  • Where did you get the binary: installed via NixOS
  • Does this issue still occur in the latest dev build? Afaik yes, because the issue is with this line, which takes the refresh rate value directly and passes it into a formatter:
    {FF_FORMAT_ARG_TYPE_DOUBLE, &result->refreshRate, "refresh-rate"},

I suppose this wouldn't really be an issue if it were possible to specify the decimal place precision in the format directly, but fastfetch -h format only provides options for truncating strings, which isn't practical as the whole number parts of refresh rates can be 2 or 3 digits long. I've tried a few other format codes I know from other languages but they have not worked.

Screenshot:
image

The content of the configuration file you use (if any):

{
    "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
    "modules": [
        "title",
        "separator",
        "os",
        "kernel",
        "uptime",
        "shell",
        "terminal",
        {
            "type": "display",
            "preciseRefreshRate": false,
            "key": "Display",
            "format": "{1}x{2} @ {3}Hz [{7}]",
        },
        "de",
        "wm",
        "theme",
        "icons",
        "font",
        "memory",
        "disk",
        "battery",
        "locale",
        "break",
        "colors"
    ]
}

Output of fastfetch --list-features:

threads
vulkan
wayland
xcb-randr
xcb
xrandr
x11
gio
dconf
dbus
imagemagick7
chafa
zlib
xfconf
sqlite3
egl
glx
opencl
libpulse
libnm
libddcutil
System yyjson
linux/videodev2
linux/wireless
@mathgeniuszach mathgeniuszach added the bug Something isn't working label Aug 25, 2024
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

1 participant