Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var VitalsMenuButton = GObject.registerClass({
this);

let settings = [ 'use-higher-precision', 'alphabetize', 'hide-zeros',
'fixed-widths', 'hide-icons', 'unit',
'fixed-widths', 'hide-icons', 'unit', 'coolant-unit',
'memory-measurement', 'include-public-ip', 'network-public-ip-interval',
'network-public-ip-show-flag', 'network-public-ip-provider', 'network-speed-format', 'network-speed-unit', 'storage-measurement',
'include-static-info', 'include-static-gpu-info' ];
Expand Down
28 changes: 24 additions & 4 deletions helpers/catalog.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/* Shared sensor catalog for shell and preferences. */
export const sensorCatalog = {
'temperature' : { 'icon': 'temperature-symbolic.svg', colorFormats: ['temp'] },
'voltage' : { 'icon': 'voltage-symbolic.svg' },
'fan' : { 'icon': 'fan-symbolic.svg', colorFormats: ['fan'] },
'temperature' : { 'icon': 'temperature-symbolic.svg', colorFormats: ['temp'], aggregate: true },
'coolant' : { 'icon': 'water-droplet-symbolic.svg', colorFormats: ['temp'], aggregate: true,
unitSetting: 'coolant-unit' },
'voltage' : { 'icon': 'voltage-symbolic.svg', aggregate: true },
'fan' : { 'icon': 'fan-symbolic.svg', colorFormats: ['fan'], aggregate: true },
'pump' : { 'icon': 'pump-symbolic.svg', colorFormats: ['fan'], aggregate: true },
'memory' : { 'icon': 'memory-symbolic.svg', colorFormats: ['percent'] },
'processor' : { 'icon': 'cpu-symbolic.svg', colorFormats: ['percent'] },
'system' : { 'icon': 'system-symbolic.svg', colorFormats: ['load'] },
Expand Down Expand Up @@ -268,11 +271,28 @@ export function sensorGroupFromType(type) {
let group = (type || '').replace(/-group$/, '');
if (group.startsWith('gpu'))
return 'gpu';
return group.replace(/#\d+$/, '');
group = group.replace(/#\d+$/, '');

// types may carry a suffix, eg 'network-rx' or 'network-us'. Every catalog
// group is a single word, so fall back to the leading segment.
if (!(group in sensorCatalog))
group = group.split('-')[0];

return group;
}

export function colorSettingsKeys() {
return Object.keys(sensorCatalog)
.filter(group => sensorCatalog[group].colorFormats)
.map(group => `${group}-colors`);
}

// groups discovered from hardware monitors and summarized by a group average
export function isAggregateGroup(group) {
return !!sensorCatalog[group]?.aggregate;
}

// a group may pick its own temperature unit, eg coolant reads coolant-unit
export function unitSettingForType(type) {
return sensorCatalog[sensorGroupFromType(type)]?.unitSetting ?? 'unit';
}
1 change: 1 addition & 0 deletions icons/gnome/pump-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/gnome/water-droplet-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 icons/original/pump-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/original/water-droplet-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ const Settings = new GObject.Class({

this._sensorPageGates = {
'temperature': { toggle: 'show-temperature', widgets: ['unit'] },
'coolant': { toggle: 'show-coolant', widgets: ['coolant-unit'] },
'voltage': { toggle: 'show-voltage', widgets: [] },
'fan': { toggle: 'show-fan', widgets: [] },
'pump': { toggle: 'show-pump', widgets: [] },
'memory': { toggle: 'show-memory', widgets: ['memory-measurement'] },
'processor': { toggle: 'show-processor', widgets: ['include-static-info'] },
'system': { toggle: 'show-system', widgets: ['monitor-cmd'] },
Expand Down Expand Up @@ -237,6 +239,7 @@ const Settings = new GObject.Class({

// process sensor toggles
let sensors = [ 'show-temperature', 'show-voltage', 'show-fan',
'show-coolant', 'show-pump',
'show-memory', 'show-processor', 'show-system',
'show-network', 'show-storage', 'use-higher-precision',
'alphabetize', 'hide-zeros', 'include-public-ip',
Expand Down Expand Up @@ -264,7 +267,7 @@ const Settings = new GObject.Class({

// process individual drop down sensor preferences
sensors = [
'position-in-panel', 'unit', 'network-speed-format', 'network-speed-unit',
'position-in-panel', 'unit', 'coolant-unit', 'network-speed-format', 'network-speed-unit',
'memory-measurement', 'storage-measurement', 'battery-slot', 'icon-style',
'network-public-ip-provider'
];
Expand Down
63 changes: 63 additions & 0 deletions prefs.ui
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,45 @@
</child>
</object>

<!-- Coolant -->
<object class="AdwPreferencesPage" id="coolant-page">
<property name="name">coolant</property>
<property name="title" translatable="yes">Coolant</property>
<property name="icon-name">water-droplet-symbolic</property>
<child>
<object class="AdwPreferencesGroup">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Monitor coolant</property>
<property name="activatable-widget">show-coolant</property>
<child type="suffix">
<object class="GtkSwitch" id="show-coolant">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Unit</property>
<property name="activatable-widget">coolant-unit</property>
<child type="suffix">
<object class="GtkComboBoxText" id="coolant-unit">
<property name="valign">center</property>
<items>
<item translatable="yes">°C</item>
<item translatable="yes">°F</item>
</items>
</object>
</child>
</object>
</child>
</object>
</child>
</object>

<!-- Voltage -->
<object class="AdwPreferencesPage" id="voltage-page">
<property name="name">voltage</property>
Expand Down Expand Up @@ -250,6 +289,30 @@
</child>
</object>

<!-- Pump -->
<object class="AdwPreferencesPage" id="pump-page">
<property name="name">pump</property>
<property name="title" translatable="yes">Pump</property>
<property name="icon-name">pump-symbolic</property>
<child>
<object class="AdwPreferencesGroup">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Monitor pump</property>
<property name="activatable-widget">show-pump</property>
<child type="suffix">
<object class="GtkSwitch" id="show-pump">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>

<!-- Memory -->
<object class="AdwPreferencesPage" id="memory-page">
<property name="name">memory</property>
Expand Down
25 changes: 25 additions & 0 deletions schemas/org.gnome.shell.extensions.vitals.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,26 @@
<summary>Temperature unit</summary>
<description>The unit ('centigrade' or 'fahrenheit') the extension should display the temperature in</description>
</key>
<key type="i" name="coolant-unit">
<default>0</default>
<summary>Coolant temperature unit</summary>
<description>The unit ('centigrade' or 'fahrenheit') the extension should display the coolant temperature in</description>
</key>
<key type="b" name="show-voltage">
<default>true</default>
<summary>Monitor voltage</summary>
<description>Display voltage of various components</description>
</key>
<key type="b" name="show-coolant">
<default>true</default>
<summary>Monitor coolant</summary>
<description>Display liquid cooling loop coolant temperature</description>
</key>
<key type="b" name="show-pump">
<default>true</default>
<summary>Monitor pump</summary>
<description>Display liquid cooling pump rotation per minute</description>
</key>
<key type="b" name="show-fan">
<default>true</default>
<summary>Monitor fan</summary>
Expand Down Expand Up @@ -179,6 +194,16 @@
<summary>Fan color thresholds</summary>
<description>Color rules matched against fan RPM. Entries are "threshold r g b".</description>
</key>
<key name="coolant-colors" type="as">
<default>["35 0.9647058844566345 0.8274509906768799 0.1764705926179886", "40 1 0.47058823704719543 0", "45 0.8784313797950745 0.10588235408067703 0.1411764770746231"]</default>
<summary>Coolant color thresholds</summary>
<description>Color rules matched against the displayed coolant temperature. Entries are "threshold r g b".</description>
</key>
<key name="pump-colors" type="as">
<default>[]</default>
<summary>Pump color thresholds</summary>
<description>Color rules matched against pump RPM. Entries are "threshold r g b".</description>
</key>
<key name="memory-colors" type="as">
<default>["65 0.9647058844566345 0.8274509906768799 0.1764705926179886", "80 1 0.47058823704719543 0", "92 0.8784313797950745 0.10588235408067703 0.1411764770746231"]</default>
<summary>Memory usage color thresholds</summary>
Expand Down
Loading