fix: correct theme memory display template for byte-to-gigabyte conversion

Updated conversion factor from 1000000000 to 1073741824. This change ensures memory usage is correctly displayed as a gigabyte (2^30 bytes).
This commit is contained in:
Christopher Narowski 2023-12-19 01:48:32 -07:00 committed by Jan De Dobbeleer
parent db32446a74
commit e976ce89c1
7 changed files with 8 additions and 10 deletions

View file

@ -69,7 +69,7 @@
{ {
"foreground": "#94ffa2", "foreground": "#94ffa2",
"style": "diamond", "style": "diamond",
"template": " <#ffffff>MEM:</> {{ round .PhysicalPercentUsed .Precision }}% ({{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1000000000.0) }}GB)", "template": " <#ffffff>MEM:</> {{ round .PhysicalPercentUsed .Precision }}% ({{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1073741824.0) }}/{{ (div .PhysicalTotalMemory 1073741824.0) }}GB)",
"type": "sysinfo" "type": "sysinfo"
} }
], ],
@ -95,9 +95,7 @@
}, },
{ {
"foreground": "#A9FFB4", "foreground": "#A9FFB4",
"foreground_templates": [ "foreground_templates": ["{{ if gt .Code 0 }}#ef5350{{ end }}"],
"{{ if gt .Code 0 }}#ef5350{{ end }}"
],
"properties": { "properties": {
"always_enabled": true "always_enabled": true
}, },

View file

@ -46,7 +46,7 @@
{ {
"foreground": "#85C980", "foreground": "#85C980",
"style": "diamond", "style": "diamond",
"template": "RAM:{{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1000000000.0) }}GB ", "template": "RAM:{{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1073741824.0) }}/{{ (div .PhysicalTotalMemory 1073741824.0) }}GB ",
"trailing_diamond": " ", "trailing_diamond": " ",
"type": "sysinfo" "type": "sysinfo"
}, },

View file

@ -79,7 +79,7 @@
{ {
"foreground": "#81ff91", "foreground": "#81ff91",
"style": "diamond", "style": "diamond",
"template": "<#cc7eda> \u007C </><#7eb8da>RAM:</> {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1000000000.0) }}GB", "template": "<#cc7eda> \u007C </><#7eb8da>RAM:</> {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1073741824.0) }}/{{ (div .PhysicalTotalMemory 1073741824.0) }}GB",
"type": "sysinfo" "type": "sysinfo"
}, },
{ {

View file

@ -44,7 +44,7 @@
"background": "#00c7fc", "background": "#00c7fc",
"foreground": "#000000", "foreground": "#000000",
"style": "diamond", "style": "diamond",
"template": "RAM: {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1000000000.0) }}GB \ue266 ", "template": "RAM: {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1073741824.0) }}/{{ (div .PhysicalTotalMemory 1073741824.0) }}GB \ue266 ",
"trailing_diamond": "<transparent,#00c7fc>\ue0b2</>", "trailing_diamond": "<transparent,#00c7fc>\ue0b2</>",
"type": "sysinfo" "type": "sysinfo"
}, },

View file

@ -12,7 +12,7 @@
{ {
"foreground": "#ff8800", "foreground": "#ff8800",
"style": "diamond", "style": "diamond",
"template": "{{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1000000000.0) }}GB ", "template": "{{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1073741824.0) }}/{{ (div .PhysicalTotalMemory 1073741824.0) }}GB ",
"type": "sysinfo" "type": "sysinfo"
} }
], ],

View file

@ -31,7 +31,7 @@
{ {
"foreground": "#be9ddf", "foreground": "#be9ddf",
"style": "diamond", "style": "diamond",
"template": "[<#ffffff>\ue266</> RAM: {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1000000000.0) }}GB]", "template": "[<#ffffff>\ue266</> RAM: {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1073741824.0) }}/{{ (div .PhysicalTotalMemory 1073741824.0) }}GB]",
"type": "sysinfo" "type": "sysinfo"
}, },
{ {

View file

@ -42,7 +42,7 @@
"background": "#516BEB", "background": "#516BEB",
"foreground": "#ffffff", "foreground": "#ffffff",
"style": "diamond", "style": "diamond",
"template": "RAM: {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1068786176.0) }}GB \ue266 ", "template": "RAM: {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1073741824.0) }}/{{ (div .PhysicalTotalMemory 1073741824.0) }}GB \ue266 ",
"trailing_diamond": "<transparent,#516BEB>\ue0b2</>", "trailing_diamond": "<transparent,#516BEB>\ue0b2</>",
"type": "sysinfo" "type": "sysinfo"
}, },