Compare commits

..
6 Commits
Author SHA1 Message Date
mount a1894539ca added net interface and increased max cpu fan speed 2026-07-25 23:21:11 +02:00
mount c6c85c0511 fixed hdd space mistake 2026-07-25 23:04:23 +02:00
mount 2f0634ed85 added graph width option and hdd usage/space options 2026-07-25 23:00:00 +02:00
mount 58a7051d99 Added possibility to display stats for LVM disks 2026-07-25 22:41:07 +02:00
mount 59d376ed5d install script added 2026-07-25 22:05:33 +02:00
mount 99b09f6c57 renamed desklet 2026-07-25 21:50:16 +02:00
19 changed files with 80 additions and 38 deletions
@@ -18,12 +18,12 @@ const KIB_TO_B = 1024; // 1 KiB = 1,024 B
const CPU_TEMP_MIN = 20; // Minimum CPU temperature
const CPU_TEMP_MAX = 100; // Maximum CPU temperature
const CPU_FANSPEED_MAX = 4000; // CPU fan graph full-scale speed
const CPU_FANSPEED_MAX = 6000; // CPU fan graph full-scale speed
const CPU_FAN_RETRY_MIN = 5; // Initial retry delay in seconds
const CPU_FAN_RETRY_MAX = 300; // Maximum retry delay in seconds
const CPU_FAN_RETRY_MULTIPLIER = 2;
const UUID = "system-monitor-graph@rcassani";
const UUID = "system-monitor-graph@mount";
const DESKLET_PATH = imports.ui.deskletManager.deskletMeta[UUID].path;
// Borrowed from battery@schorschii
@@ -112,6 +112,7 @@ SystemMonitorGraph.prototype = {
this.settings.bindProperty(Settings.BindingDirection.IN, "battery-name", "battery_name", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "filesystem", "filesystem", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "filesystem-label", "filesystem_label", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "filesystem-variable", "filesystem_variable", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "gpu-manufacturer", "gpu_manufacturer", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "gpu-variable", "gpu_variable", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "temperature-units-gpu", "temperature_units_gpu", this.on_setting_changed);
@@ -122,6 +123,7 @@ SystemMonitorGraph.prototype = {
this.settings.bindProperty(Settings.BindingDirection.IN, "h-midlines", "h_midlines", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "v-midlines", "v_midlines", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "scale-size", "scale_size", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "graph-width", "graph_width", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "midline-color", "midline_color", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "text-color", "text_color", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "line-color-cpu", "line_color_cpu", this.on_setting_changed);
@@ -256,7 +258,7 @@ SystemMonitorGraph.prototype = {
let unit_size = 15 * this.scale_size * global.ui_scale; // pixels
var line_width = unit_size / 15;
var margin_up = 3 * unit_size;
var graph_w = 20 * unit_size;
var graph_w = this.graph_width * unit_size;
var graph_h = 4 * unit_size;
let desklet_w = graph_w + (2 * unit_size);
let desklet_h = graph_h + (4 * unit_size);
@@ -365,7 +367,16 @@ SystemMonitorGraph.prototype = {
if(dir_path == null || dir_path == "") dir_path = "/";
this.get_hdd_values(dir_path);
let hdd_use = Math.min(this.hdd_values[1], 100); //already in %
let hdd_free = this.hdd_values[3].toFixed(0);
let hdd_total = this.hdd_values[2].toFixed(0);
switch (this.filesystem_variable) {
case "usage":
value = hdd_use / 100;
break;
case "space":
value = 1.0 - hdd_free / hdd_total;
break;
}
let hdd_prefix = "";
if (this.data_prefix_hdd == 1) {
// decimal prefix
@@ -377,8 +388,8 @@ SystemMonitorGraph.prototype = {
text1 = this.filesystem_label;
if (text1 == "") text1 = this.hdd_values[0].toString();
text2 = Math.round(hdd_use).toString() + "%"
text3 = this.hdd_values[3].toFixed(0) + " " + hdd_prefix + " " + _("free of") + " "
+ this.hdd_values[2].toFixed(0) + " " + hdd_prefix;
text3 = hdd_free + " " + hdd_prefix + " " + _("free of") + " "
+ hdd_total + " " + hdd_prefix;
break;
case "gpu":
@@ -445,7 +456,12 @@ SystemMonitorGraph.prototype = {
this.get_network_values();
// For network, we don't use the single 'value' variable as we have dual lines
value = 0; // Not used for network type
if (this.network_interface) {
text1 = _("Network " + this.network_interface);
} else {
text1 = _("Network");
}
// Format speeds with appropriate units
let down_speed_formatted = this.format_network_speed(this.net_down_speed);
@@ -562,7 +578,7 @@ SystemMonitorGraph.prototype = {
this.text3.style = "font-size: " + text3_size + "px;"
+ "color: " + this.text_color + ";";
this.text3.set_position(
Math.round((21 * unit_size) - this.text3.get_width()),
Math.round(((this.graph_width+1) * unit_size) - this.text3.get_width()),
Math.round((2.5 * unit_size) - this.text3.get_height()));
@@ -863,6 +879,11 @@ SystemMonitorGraph.prototype = {
// get IO utilization of partition
let dev_fs = df_values[0];
let fs = dev_fs.split(/\/+/)[2];
try {
fs = GLib.file_read_link(dev_fs).split(/\/+/)[1];
}
catch (e) {
}
let re = new RegExp(fs + '.+');
// https://stackoverflow.com/questions/4458183/how-the-util-of-iostat-is-computed
this.cpu_file.load_contents_async(null, (file, response) => {

Before

Width:  |  Height:  |  Size: 800 B

After

Width:  |  Height:  |  Size: 800 B

@@ -1,6 +1,6 @@
{
"max-instances": "20",
"uuid": "system-monitor-graph@rcassani",
"uuid": "system-monitor-graph@mount",
"name": "System monitor graph",
"description": "Creates graphs for system variables.",
"version": "2.2",
@@ -153,8 +153,8 @@ msgid "Creates graphs for system variables."
msgstr "Crea gràfiques de les variables del sistema."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Ajusts de system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Ajusts de system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -152,8 +152,8 @@ msgid "Creates graphs for system variables."
msgstr "Laver grafer for systemvariable."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Indstillinger for system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Indstillinger for system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -154,8 +154,8 @@ msgid "Creates graphs for system variables."
msgstr "Zeigt Graphen von Systemvariablen."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Einstellungen für system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Einstellungen für system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -153,8 +153,8 @@ msgid "Creates graphs for system variables."
msgstr "Crea gráficos para las variables del sistema."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Configuración de system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Configuración de system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -158,8 +158,8 @@ msgstr ""
"liittyvistä asioista."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Asetukset system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Asetukset system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -152,8 +152,8 @@ msgid "Creates graphs for system variables."
msgstr "Grafikonokat készít a rendszer jellemző értékeiből."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Beállítások a system-monitor-graph@rcassani asztalkalmazáshoz"
msgid "Settings for system-monitor-graph@mount"
msgstr "Beállítások a system-monitor-graph@mount asztalkalmazáshoz"
#. settings-schema.json->head1->description
msgid "General"
@@ -153,8 +153,8 @@ msgid "Creates graphs for system variables."
msgstr "Crea grafici per variabili di sistema."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Impostazioni per system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Impostazioni per system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -151,8 +151,8 @@ msgid "Creates graphs for system variables."
msgstr "Creëert grafieken voor systeemvariabelen."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Instellingen voor system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Instellingen voor system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -156,8 +156,8 @@ msgid "Creates graphs for system variables."
msgstr "Cria gráficos para variáveis do sistema."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Configurações de system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Configurações de system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -155,8 +155,8 @@ msgid "Creates graphs for system variables."
msgstr "Creează grafice pentru variabilele de sistem."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Setări pentru system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Setări pentru system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -148,8 +148,8 @@ msgid "Creates graphs for system variables."
msgstr "Отображает графики системных параметров."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Настройки для system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Настройки для system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -5,7 +5,7 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: system-monitor-graph@rcassani 2.2\n"
"Project-Id-Version: system-monitor-graph@mount 2.2\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-desklets/"
"issues\n"
"POT-Creation-Date: 2026-07-22 14:45+0530\n"
@@ -151,7 +151,7 @@ msgid "Creates graphs for system variables."
msgstr ""
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr ""
#. settings-schema.json->head1->description
@@ -5,7 +5,7 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: system-monitor-graph@rcassani 2.0\n"
"Project-Id-Version: system-monitor-graph@mount 2.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-desklets/issues\n"
"POT-Creation-Date: 2026-07-22 14:45+0530\n"
"PO-Revision-Date: \n"
@@ -152,8 +152,8 @@ msgid "Creates graphs for system variables."
msgstr "Tạo biểu đồ cho các biến hệ thống."
#. settings-schema.json->head0->description
msgid "Settings for system-monitor-graph@rcassani"
msgstr "Cài đặt cho system-monitor-graph@rcassani"
msgid "Settings for system-monitor-graph@mount"
msgstr "Cài đặt cho system-monitor-graph@mount"
#. settings-schema.json->head1->description
msgid "General"
@@ -1,7 +1,7 @@
{
"head0": {
"type": "header",
"description": "Settings for system-monitor-graph@rcassani"
"description": "Settings for system-monitor-graph@mount"
},
"head1": {
@@ -121,6 +121,17 @@
"tooltip": "Empty uses the filesystem name from df.",
"dependency": "type=hdd"
},
"filesystem-variable": {
"type": "combobox",
"default": "usage",
"description": "HDD variable to monitor",
"tooltip": "Select the HDD variable to monitor.",
"options" : {
"Usage" : "usage",
"Space": "space"
},
"dependency": "type=hdd"
},
"gpu-manufacturer": {
"type": "combobox",
"default": "nvidia",
@@ -305,5 +316,13 @@
"max": 5,
"step": 0.1,
"description": "Scale factor for desklet size (scale factor of 1 = 330 x 120 px)"
},
"graph-width": {
"type": "scale",
"default": 20,
"min": 1,
"max": 50,
"step": 1,
"description": "Graph width"
}
}
+1 -1
View File
@@ -1 +1 @@
{"author": "rcassani"}
{"author": "mount"}
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/bash
cp -r files/* ~/.local/share/cinnamon/desklets/