Improve utility for video card prefs

This commit is contained in:
UshakovVasilii
2014-07-10 21:37:08 +04:00
parent 3024c636ef
commit c254c19133
5 changed files with 43 additions and 51 deletions

View File

@@ -1,7 +1,7 @@
gnome-shell-extension-freon
====================================
Freon is forked from [gnome-shell-extension-sensors](https://github.com/xtranophilist/gnome-shell-extension-sensors). Freon is an extension for displaying CPU temperature, HDD/SSD temperature, AMD video card temperature (Catalyst), voltage and CPU fan RPM in GNOME Shell.
Freon is forked from [gnome-shell-extension-sensors](https://github.com/xtranophilist/gnome-shell-extension-sensors). Freon is an extension for displaying CPU temperature, HDD/SSD temperature, video card temperature (Nvidia/Catalyst), voltage and fan RPM in GNOME Shell.
More info in [wiki](https://github.com/UshakovVasilii/gnome-shell-extension-freon/wiki)

View File

@@ -58,10 +58,7 @@ const FreonMenuButton = new Lang.Class({
this._utils.sensors.detect();
this._initDriveUtility();
if(this._settings.get_boolean('show-aticonfig-temp'))
this._utils.aticonfig.detect();
if(this._settings.get_boolean('show-nvidia-temp'))
this._utils.nvidia.detect();
this._initGpuUtility();
this._settingChangedSignals = [];
this._addSettingChangedSignal('update-time', Lang.bind(this, this._updateTimeChanged));
@@ -71,9 +68,8 @@ const FreonMenuButton = new Lang.Class({
this._addSettingChangedSignal('show-decimal-value', Lang.bind(this, this._querySensors));
this._addSettingChangedSignal('show-fan-rpm', Lang.bind(this, this._querySensors));
this._addSettingChangedSignal('show-voltage', Lang.bind(this, this._querySensors));
this._addSettingChangedSignal('show-aticonfig-temp', Lang.bind(this, this._showAtiConfigChanged));
this._addSettingChangedSignal('show-nvidia-temp', Lang.bind(this, this._showNvidiaChanged));
this._addSettingChangedSignal('drive-utility', Lang.bind(this, this._driveUtilityChanged));
this._addSettingChangedSignal('gpu-utility', Lang.bind(this, this._gpuUtilityChanged));
this._addSettingChangedSignal('position-in-panel', Lang.bind(this, this._positionInPanelChanged));
this.connect('destroy', Lang.bind(this, this._onDestroy));
@@ -134,27 +130,33 @@ const FreonMenuButton = new Lang.Class({
this._utils.hddtemp.destroy();
},
_initGpuUtility : function(){
switch(this._settings.get_string('gpu-utility')){
case 'nvidia-settings':
this._utils.nvidia.detect();
break;
case 'aticonfig':
this._utils.aticonfig.detect();
break;
}
},
_destroyGpuUtility : function(){
this._utils.nvidia.destroy();
this._utils.aticonfig.destroy();
},
_gpuUtilityChanged : function(){
this._destroyGpuUtility();
this._initGpuUtility();
this._querySensors();
},
_updateTimeChanged : function(){
Mainloop.source_remove(this._timeoutId);
this._addTimer();
},
_showAtiConfigChanged : function(){
if(this._settings.get_boolean('show-aticonfig-temp'))
this._utils.aticonfig.detect();
else
this._utils.aticonfig.destroy();
this._querySensors();
},
_showNvidiaChanged : function(){
if(this._settings.get_boolean('show-nvidia-temp'))
this._utils.nvidia.detect();
else
this._utils.nvidia.destroy();
this._querySensors();
},
_addTimer : function(){
this._timeoutId = Mainloop.timeout_add_seconds(this._settings.get_int('update-time'), Lang.bind(this, function (){
this._querySensors();

View File

@@ -54,27 +54,23 @@ const FreonPrefsWidget = new GObject.Class({
this._addSwitch({key : 'show-icon-on-panel', y : i++, x : 2,
label : _('Show Icon on Panel')});
this._addSwitch({key : 'show-fan-rpm', y : i, x : 0,
label : _('Show Fan Speed')});
this._addSwitch({key : 'show-voltage', y : i++, x : 2,
label : _('Show Power Supply Voltage')});
this._addComboBox({
items : {none : 'None', hddtemp : 'Hddtemp', udisks2 : 'UDisks2'},
key: 'drive-utility', y : i, x : 0,
label: _('Utility for HDD/SSD Temperature')
label: _('HDD/SSD Temperature Utility')
});
//
this._addSwitch({key : 'show-fan-rpm', y : i++, x : 2,
label : _('Show Fan Speed')});
this._addSwitch({key : 'show-voltage', y : i, x : 0,
label : _('Show Power Supply Voltage')});
this._addSwitch({key : 'show-aticonfig-temp', y : i++, x : 2,
label : _('Use Catalyst'),
help : _('Show AMD video card temperature, use aticonfig from Catalyst driver')});
this._addSwitch({key : 'show-nvidia-temp', y : i, x : 0,
label : _('Use NVIDIA'),
help : _('Show NVIDIA video card temperature, use nvidia-settings util')});
this._addComboBox({
items : {none : 'None', 'nvidia-settings' : 'Nvidia', aticonfig : 'Catalyst'},
key: 'gpu-utility', y : i, x : 2,
label: _('Video Card Temperature Utility')
});
},
_addSwitch : function(params){

View File

@@ -45,24 +45,18 @@
<description>Display voltage of various components</description>
</key>
<key type="b" name="show-aticonfig-temp">
<default>false</default>
<summary>Show AMD Card Temperature (Catalyst)</summary>
<description>Show AMD card temperature, use aticonfig from Catalyst driver</description>
</key>
<key type="b" name="show-nvidia-temp">
<default>false</default>
<summary>Show NVIDIA Card Temperature</summary>
<description>Show NVIDIA card temperature, use nvidia-settings util</description>
</key>
<key type="s" name="drive-utility">
<default>'udisks2'</default>
<summary>Utility for detect HDD/SSD temperature</summary>
<description>Utility for detect HDD/SSD temperature ('none', 'hddtemp' or 'udisks2')</description>
</key>
<key type="s" name="gpu-utility">
<default>'none'</default>
<summary>Utility for detect video card temperature</summary>
<description>Utility for detect video card temperature ('none', 'nvidia-settings' or 'aticonfig')</description>
</key>
<key type="s" name="position-in-panel">
<default>'right'</default>
<summary>Position in Panel</summary>