From f896657f01300a71213e2825280ed3b9375ce880 Mon Sep 17 00:00:00 2001 From: Alexandre Leconte Date: Tue, 26 Mar 2024 08:44:34 +0100 Subject: [PATCH 1/3] Adding support for battery with key 'BATT' --- prefs.ui | 1 + sensors.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/prefs.ui b/prefs.ui index ab07185..537decf 100644 --- a/prefs.ui +++ b/prefs.ui @@ -1222,6 +1222,7 @@ BAT0 BAT1 BAT2 + BATT CMB0 macsmc-battery diff --git a/sensors.js b/sensors.js index 2ba8c2e..344767f 100644 --- a/sensors.js +++ b/sensors.js @@ -373,9 +373,11 @@ export const Sensors = GObject.registerClass({ // addresses issue #161 let battery_key = 'BAT'; // BAT0, BAT1 and BAT2 if (battery_slot == 3) { + battery_slot = 'T'; + } else if (battery_slot == 4) { battery_key = 'CMB'; // CMB0 battery_slot = 0; - } else if (battery_slot == 4) { + } else if (battery_slot == 5) { battery_key = 'macsmc-battery'; // supports Asahi linux battery_slot = ''; } From 9a49363b1e2d3927cfb290013b24b51a426e352e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= Date: Thu, 28 Mar 2024 08:31:47 +0100 Subject: [PATCH 2/3] Add more details about swap usage In addition to the used swap, display total and free swap as well as the percentage of used swap. --- sensors.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sensors.js b/sensors.js index 2ba8c2e..d3854d5 100644 --- a/sensors.js +++ b/sensors.js @@ -140,6 +140,8 @@ export const Sensors = GObject.registerClass({ let used = total - avail let utilized = used / total; + let swapUsed = swapTotal - swapFree + let swapUtilized = swapUsed / swapTotal; this._returnValue(callback, 'Usage', utilized, 'memory', 'percent'); this._returnValue(callback, 'memory', utilized, 'memory-group', 'percent'); @@ -148,7 +150,10 @@ export const Sensors = GObject.registerClass({ this._returnValue(callback, 'Allocated', used, 'memory', 'memory'); this._returnValue(callback, 'Cached', cached, 'memory', 'memory'); this._returnValue(callback, 'Free', memFree, 'memory', 'memory'); - this._returnValue(callback, 'Swap', swapTotal - swapFree, 'memory', 'memory'); + this._returnValue(callback, 'Swap Total', swapTotal, 'memory', 'memory'); + this._returnValue(callback, 'Swap Free', swapFree, 'memory', 'memory'); + this._returnValue(callback, 'Swap Used', swapUsed, 'memory', 'memory'); + this._returnValue(callback, 'Swap Usage', swapUtilized, 'memory', 'percent'); }).catch(err => { }); } From c521824cbbcba5e960fe41df131ea352025e02e9 Mon Sep 17 00:00:00 2001 From: daudix Date: Thu, 28 Mar 2024 23:18:23 +0300 Subject: [PATCH 3/3] Update battery and GPU icons in GNOME icon set As mentioned in #411 --- icons/gnome/battery-symbolic.svg | 9 +-------- icons/gnome/cpu-symbolic.svg | 2 +- icons/gnome/fan-symbolic.svg | 2 +- icons/gnome/gpu-symbolic.svg | 16 +--------------- icons/gnome/memory-symbolic.svg | 2 +- icons/gnome/network-download-symbolic.svg | 2 +- icons/gnome/network-symbolic.svg | 2 +- icons/gnome/network-upload-symbolic.svg | 2 +- icons/gnome/storage-symbolic.svg | 2 +- icons/gnome/system-symbolic.svg | 2 +- icons/gnome/temperature-symbolic.svg | 2 +- icons/gnome/voltage-symbolic.svg | 2 +- 12 files changed, 12 insertions(+), 33 deletions(-) diff --git a/icons/gnome/battery-symbolic.svg b/icons/gnome/battery-symbolic.svg index 70df9ee..28a9887 100644 --- a/icons/gnome/battery-symbolic.svg +++ b/icons/gnome/battery-symbolic.svg @@ -1,8 +1 @@ - - - - - - - - + \ No newline at end of file diff --git a/icons/gnome/cpu-symbolic.svg b/icons/gnome/cpu-symbolic.svg index 86ca8bf..31c397b 100644 --- a/icons/gnome/cpu-symbolic.svg +++ b/icons/gnome/cpu-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/gnome/fan-symbolic.svg b/icons/gnome/fan-symbolic.svg index ea2b44f..234f797 100644 --- a/icons/gnome/fan-symbolic.svg +++ b/icons/gnome/fan-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/gnome/gpu-symbolic.svg b/icons/gnome/gpu-symbolic.svg index d5cf157..b59beda 100644 --- a/icons/gnome/gpu-symbolic.svg +++ b/icons/gnome/gpu-symbolic.svg @@ -1,15 +1 @@ - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/icons/gnome/memory-symbolic.svg b/icons/gnome/memory-symbolic.svg index 1946901..7fb2200 100644 --- a/icons/gnome/memory-symbolic.svg +++ b/icons/gnome/memory-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/gnome/network-download-symbolic.svg b/icons/gnome/network-download-symbolic.svg index 4fc170b..7ec91a8 100644 --- a/icons/gnome/network-download-symbolic.svg +++ b/icons/gnome/network-download-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/gnome/network-symbolic.svg b/icons/gnome/network-symbolic.svg index 2ff9778..125ba60 100644 --- a/icons/gnome/network-symbolic.svg +++ b/icons/gnome/network-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/gnome/network-upload-symbolic.svg b/icons/gnome/network-upload-symbolic.svg index 0d67f65..bd31f33 100644 --- a/icons/gnome/network-upload-symbolic.svg +++ b/icons/gnome/network-upload-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/gnome/storage-symbolic.svg b/icons/gnome/storage-symbolic.svg index 30d9007..b0d4753 100644 --- a/icons/gnome/storage-symbolic.svg +++ b/icons/gnome/storage-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/gnome/system-symbolic.svg b/icons/gnome/system-symbolic.svg index bfbf1bd..a041518 100644 --- a/icons/gnome/system-symbolic.svg +++ b/icons/gnome/system-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/gnome/temperature-symbolic.svg b/icons/gnome/temperature-symbolic.svg index e00a2eb..ed976bf 100644 --- a/icons/gnome/temperature-symbolic.svg +++ b/icons/gnome/temperature-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/gnome/voltage-symbolic.svg b/icons/gnome/voltage-symbolic.svg index 1aa2210..c786442 100644 --- a/icons/gnome/voltage-symbolic.svg +++ b/icons/gnome/voltage-symbolic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file