Skip to content

[module/memory] Display MiB instead of GiB when GiB value is less than 1GiB #2472

@malta895

Description

@malta895

Is your feature request related to a problem? Please describe.

I find more intuitive if the memory/swap values are displayed in MiB instead of GiB when the value is less than 1 GiB, for better precision.
For example, display 512 MiB instead of 0.50 GiB.

Coming from i3-status, which does this by default, I find this more appropiate

Why does polybar need this feature?

I think that when values are lower than 1GiB is better to see their MiB value: we have an higher precision and the same number of digits.

Describe the solution you'd like

In addition to the already existing label tokens:

;   %gb_used%
;   %gb_free%
;   %gb_total%
;   %mb_used%
;   %mb_free%
;   %mb_total%

add something like:

;   %mb_gb_used%
;   %mb_gb_free%
;   %mb_gb_total%

that show the memory value as described earlier.

I'd like the same options available also for swap.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions