Checklist before submitting an issue
Description of the bug
The EWW_RAM.used_mem magic variable cannot be used in formatbytes without being cast to an int through floor/ceil, which is inconsistent with the other memory magics that return bytes as integers
Reproducing the issue
This will happily display available mem, but error for used mem.
(defwindow example
:monitor 0
:geometry (geometry :x 0 :y 0 :anchor "top center")
:stacking "fg" :windowtype "dock"
(box :orientation "horizontal"
"used_mem: ${formatbytes(EWW_RAM.used_mem, true, 'iec')}"
"|"
"available_mem: ${formatbytes(EWW_RAM.available_mem, true, 'iec')}"))
Expected behaviour
Expected this to work
"${formatbytes(EWW_RAM.used_mem, true, 'iec'}"
like this does
"${formatbytes(EWW_RAM.available_mem, true, 'iec')}"
Additional context
Error output:
error: Failed to turn 15014653952.0 into a value of type i64
┌─ /home/USER/.config/eww/eww.yuck:52:30
│
52 │ "${formatbytes(EWW_RAM.used_mem, true, 'iec')}"
Other memory information uses the sysinfo crate and it looks like that returns u64's, while used_mem explicitly casts them to f32 to do its subtraction.
Platform and environment
Wayland
Niri
eww 0.6.0 865cf63
Checklist before submitting an issue
Description of the bug
The
EWW_RAM.used_memmagic variable cannot be used informatbyteswithout being cast to an int through floor/ceil, which is inconsistent with the other memory magics that return bytes as integersReproducing the issue
This will happily display available mem, but error for used mem.
Expected behaviour
Expected this to work
"${formatbytes(EWW_RAM.used_mem, true, 'iec'}"like this does
"${formatbytes(EWW_RAM.available_mem, true, 'iec')}"Additional context
Error output:
Other memory information uses the sysinfo crate and it looks like that returns
u64's, while used_mem explicitly casts them tof32to do its subtraction.Platform and environment
Wayland
Niri
eww 0.6.0 865cf63