diff --git a/README.md b/README.md index c5673927..fbc66bfc 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/extension.js b/extension.js index 2d4d35a7..31dcce5d 100644 --- a/extension.js +++ b/extension.js @@ -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) => { @@ -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. @@ -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]; } diff --git a/helpers/catalog.js b/helpers/catalog.js index e6e09235..af558a5f 100644 --- a/helpers/catalog.js +++ b/helpers/catalog.js @@ -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', diff --git a/icons/gnome/network-download-symbolic.svg b/icons/gnome/network-download-symbolic.svg index 93e136f6..aa3bbe59 100644 --- a/icons/gnome/network-download-symbolic.svg +++ b/icons/gnome/network-download-symbolic.svg @@ -1 +1,46 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/gnome/network-upload-symbolic.svg b/icons/gnome/network-upload-symbolic.svg index 0da2f3bf..599bdafc 100644 --- a/icons/gnome/network-upload-symbolic.svg +++ b/icons/gnome/network-upload-symbolic.svg @@ -1 +1,46 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/gnome/swap-symbolic.svg b/icons/gnome/swap-symbolic.svg new file mode 100644 index 00000000..ec2c75f0 --- /dev/null +++ b/icons/gnome/swap-symbolic.svg @@ -0,0 +1,2 @@ + +