diff --git a/sysmonitor@orcus/files/sysmonitor@orcus/3.2/applet.js b/sysmonitor@orcus/files/sysmonitor@orcus/3.2/applet.js index d1d4188da19..2e9869b73cc 100644 --- a/sysmonitor@orcus/files/sysmonitor@orcus/3.2/applet.js +++ b/sysmonitor@orcus/files/sysmonitor@orcus/3.2/applet.js @@ -117,6 +117,8 @@ MyApplet.prototype = { ["mem_graph_width", this.on_cfg_changed_graph_width], ["mem_color_0", this.on_cfg_changed_color, 1], ["mem_color_1", this.on_cfg_changed_color, 1], + ["mem_color_2", this.on_cfg_changed_color, 1], + ["mem_color_3", this.on_cfg_changed_color, 1], ["swap_enabled", this.on_cfg_changed_graph_enabled, 2], ["swap_override_graph_width", this.on_cfg_changed_graph_width, 2], ["swap_graph_width", this.on_cfg_changed_graph_width], diff --git a/sysmonitor@orcus/files/sysmonitor@orcus/3.2/providers.js b/sysmonitor@orcus/files/sysmonitor@orcus/3.2/providers.js index c1c2dfa9e66..35e0a8191cb 100644 --- a/sysmonitor@orcus/files/sysmonitor@orcus/3.2/providers.js +++ b/sysmonitor@orcus/files/sysmonitor@orcus/3.2/providers.js @@ -71,16 +71,20 @@ MemData.prototype = { }, getDim: function() { - return 2; + return 4; }, getData: function() { GTop.glibtop_get_mem(this.gtop); - let used = this.gtop.used / this.gtop.total; - let cached = (this.gtop.buffer + this.gtop.cached) / this.gtop.total; - this.text = Math.round((this.gtop.used - this.gtop.cached - this.gtop.buffer) / (1024 * 1024)) - + " / " + Math.round(this.gtop.total / (1024 * 1024)) + _(" MB"); - return [used-cached, cached]; + let total = this.gtop.total; + let cached = this.gtop.cached - this.gtop.shared; + let shared = this.gtop.shared; + let buffer = this.gtop.buffer; + let used = this.gtop.used - this.gtop.cached - this.gtop.buffer; + + this.text = Math.round((used + shared) / (1024 * 1024)) + + " / " + Math.round(total / (1024 * 1024)) + _(" MB"); + return [used, shared, buffer, cached].map(e => e / this.gtop.total); }, getText: function() { diff --git a/sysmonitor@orcus/files/sysmonitor@orcus/3.2/settings-schema.json b/sysmonitor@orcus/files/sysmonitor@orcus/3.2/settings-schema.json index 57e2a2024c5..81eaa032de3 100644 --- a/sysmonitor@orcus/files/sysmonitor@orcus/3.2/settings-schema.json +++ b/sysmonitor@orcus/files/sysmonitor@orcus/3.2/settings-schema.json @@ -45,7 +45,7 @@ "mem_c": { "type": "section", "title": "Colors", - "keys": ["mem_color_0", "mem_color_1"] + "keys": ["mem_color_0", "mem_color_1", "mem_color_2", "mem_color_3"] }, "swap": { "type": "page", @@ -247,8 +247,18 @@ "description": "Used color" }, "mem_color_1": { + "type": "colorchooser", + "default": "rgb(117,78,210)", + "description": "Shared color" + }, + "mem_color_2": { "type": "colorchooser", "default": "rgb(52,101,164)", + "description": "Buffer color" + }, + "mem_color_3": { + "type": "colorchooser", + "default": "rgb(220,182,48)", "description": "Cached color" }, "swap_enabled": {