Skip to content

Commit

Permalink
Merge pull request #419 from corecoding/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
corecoding authored Apr 4, 2024
2 parents c2348f1 + e8b8685 commit 7c50c82
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 35 deletions.
9 changes: 1 addition & 8 deletions icons/gnome/battery-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/cpu-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/fan-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 1 addition & 15 deletions icons/gnome/gpu-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/memory-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/network-download-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/network-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/network-upload-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/storage-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/system-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/temperature-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/gnome/voltage-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions prefs.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@
<item translatable="yes">BAT0</item>
<item translatable="yes">BAT1</item>
<item translatable="yes">BAT2</item>
<item translatable="yes">BATT</item>
<item translatable="yes">CMB0</item>
<item translatable="yes">macsmc-battery</item>
</items>
Expand Down
11 changes: 9 additions & 2 deletions sensors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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 => { });
}

Expand Down Expand Up @@ -373,9 +378,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 = '';
}
Expand Down

0 comments on commit 7c50c82

Please sign in to comment.