mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-14 00:14:14 +09:00
Sort sensor names with the numeric option set (#265)
This allows "Core 3" to sort before "Core 20", instead of the other way around without the numeric option set.
This commit is contained in:
@@ -587,11 +587,12 @@ const FreonMenuButton = GObject.registerClass(class Freon_FreonMenuButton extend
|
||||
if (this._settings.get_boolean('show-temperature'))
|
||||
driveTempInfo = driveTempInfo.concat(this._utils.nvmecli.temp);
|
||||
|
||||
sensorsTempInfo.sort(function(a,b) { return a.label.localeCompare(b.label) });
|
||||
driveTempInfo.sort(function(a,b) { return a.label.localeCompare(b.label) });
|
||||
fanInfo.sort(function(a,b) { return a.label.localeCompare(b.label) });
|
||||
voltageInfo.sort(function(a,b) { return a.label.localeCompare(b.label) });
|
||||
powerInfo.sort(function(a,b) { return a.label.localeCompare(b.label) });
|
||||
const comparator = (a, b) => a.label.localeCompare(b.label, undefined, {numeric: true})
|
||||
sensorsTempInfo.sort(comparator);
|
||||
driveTempInfo.sort(comparator);
|
||||
fanInfo.sort(comparator);
|
||||
voltageInfo.sort(comparator);
|
||||
powerInfo.sort(comparator);
|
||||
|
||||
let tempInfo = gpuTempInfo.concat(sensorsTempInfo).concat(driveTempInfo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user