Skip to content
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Vitals was originally forked from [gnome-shell-extension-freon](https://github.c

### GNOME Theme
* (battery | storage)-symbolic.svg - from [Adwaita Icon Theme](https://gitlab.gnome.org/GNOME/adwaita-icon-theme).
* (memory | network* | system | voltage)-symbolic.svg - from [Icon Development Kit](https://gitlab.gnome.org/Teams/Design/icon-development-kit).
* (memory | network* | swap | system | voltage)-symbolic.svg - from [Icon Development Kit](https://gitlab.gnome.org/Teams/Design/icon-development-kit).
* fan-symbolic.svg - inherited from [Freon](https://github.com/UshakovVasilii/gnome-shell-extension-freon) project, with mild modifications.
* (temperature | cpu)-symbolic.svg - designed by [daudix](https://github.com/daudix).

Expand Down
8 changes: 5 additions & 3 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ var VitalsMenuButton = GObject.registerClass({
let split = sensor.type.split('-');
let type = split[0];
let icon = (split.length == 2)?'icon-' + split[1]:'icon';
let gicon = Gio.icon_new_for_string(this._sensorIconPath(type, icon));
let gicon = Gio.icon_new_for_string(this._sensorIconPath(type, icon, key));

let item = new MenuItem.MenuItem(gicon, key, sensor.label, sensor.value, this._hotLabels[key]);
item.connect('toggle', (self) => {
Expand Down Expand Up @@ -484,13 +484,13 @@ var VitalsMenuButton = GObject.registerClass({
icon.gicon = Gio.icon_new_for_string(this._sensorIconPath('system'));
} else { // support for hide icons #80
let iconObj = (split.length == 2)?'icon-' + split[1]:'icon';
icon.gicon = Gio.icon_new_for_string(this._sensorIconPath(type, iconObj));
icon.gicon = Gio.icon_new_for_string(this._sensorIconPath(type, iconObj, key));
}

return icon;
}

_sensorIconPath(sensor, icon = 'icon') {
_sensorIconPath(sensor, icon = 'icon', key = '') {
let sensorKey = sensor;

// If the sensor is a numbered gpu, use the gpu icon. Otherwise use whatever icon associated with the sensor name.
Expand All @@ -505,6 +505,8 @@ var VitalsMenuButton = GObject.registerClass({
}

const iconPathPrefixIndex = this._settings.get_int('icon-style');
if (sensorKey === 'memory' && iconPathPrefixIndex === 1 && key.startsWith('_memory_swap_'))
icon = 'icon-swap';
return this._extensionObject.path + this._sensorsIconPathPrefix[iconPathPrefixIndex] + icons[icon];
}

Expand Down
2 changes: 1 addition & 1 deletion helpers/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const sensorCatalog = {
'temperature' : { 'icon': 'temperature-symbolic.svg', colorFormats: ['temp'] },
'voltage' : { 'icon': 'voltage-symbolic.svg' },
'fan' : { 'icon': 'fan-symbolic.svg', colorFormats: ['fan'] },
'memory' : { 'icon': 'memory-symbolic.svg', colorFormats: ['percent'] },
'memory' : { 'icon': 'memory-symbolic.svg', 'icon-swap': 'swap-symbolic.svg', colorFormats: ['percent'] },
'processor' : { 'icon': 'cpu-symbolic.svg', colorFormats: ['percent'] },
'system' : { 'icon': 'system-symbolic.svg', colorFormats: ['load'] },
'network' : { 'icon': 'network-symbolic.svg',
Expand Down
47 changes: 46 additions & 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.
47 changes: 46 additions & 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: 2 additions & 0 deletions icons/gnome/swap-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.