mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-15 00:44:22 +09:00
refactored project name, configuration etc. from cpu-temperature to sensors [#57]
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
gschemas.compiled
|
gschemas.compiled
|
||||||
|
*~
|
||||||
|
|||||||
16
extension.js
16
extension.js
@@ -13,19 +13,19 @@ const Shell = imports.gi.Shell;
|
|||||||
let settings;
|
let settings;
|
||||||
let metadata = Me.metadata;
|
let metadata = Me.metadata;
|
||||||
|
|
||||||
function CpuTemperature() {
|
function Sensors() {
|
||||||
this._init.apply(this, arguments);
|
this._init.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
CpuTemperature.prototype = {
|
Sensors.prototype = {
|
||||||
__proto__: PanelMenu.SystemStatusButton.prototype,
|
__proto__: PanelMenu.SystemStatusButton.prototype,
|
||||||
|
|
||||||
_init: function(){
|
_init: function(){
|
||||||
PanelMenu.SystemStatusButton.prototype._init.call(this, 'temperature');
|
PanelMenu.SystemStatusButton.prototype._init.call(this, 'sensors');
|
||||||
|
|
||||||
this.statusLabel = new St.Label({
|
this.statusLabel = new St.Label({
|
||||||
text: "--",
|
text: "--",
|
||||||
style_class: "temperature-label"
|
style_class: "sensors-label"
|
||||||
});
|
});
|
||||||
|
|
||||||
// destroy all previously created children, and add our statusLabel
|
// destroy all previously created children, and add our statusLabel
|
||||||
@@ -43,7 +43,7 @@ CpuTemperature.prototype = {
|
|||||||
if (display_hdd_temp){
|
if (display_hdd_temp){
|
||||||
this.hddtempPath = this._detectHDDTemp();
|
this.hddtempPath = this._detectHDDTemp();
|
||||||
}
|
}
|
||||||
this.command=["xdg-open", "http://github.com/xtranophilist/gnome-shell-extension-cpu-temperature/issues/"];
|
this.command=["xdg-open", "http://github.com/xtranophilist/gnome-shell-extension-sensors/issues/"];
|
||||||
if(this.sensorsPath){
|
if(this.sensorsPath){
|
||||||
this.title='Error';
|
this.title='Error';
|
||||||
this.content='Run sensors-detect as root. If it doesn\'t help, click here to report with your sensors output!';
|
this.content='Run sensors-detect as root. If it doesn\'t help, click here to report with your sensors output!';
|
||||||
@@ -388,7 +388,7 @@ CpuTemperature.prototype = {
|
|||||||
}
|
}
|
||||||
let format = '%.1f';
|
let format = '%.1f';
|
||||||
if (!settings.get_boolean('display-decimal-value')){
|
if (!settings.get_boolean('display-decimal-value')){
|
||||||
ret = Math.round(value);
|
//ret = Math.round(value);
|
||||||
format = '%d';
|
format = '%d';
|
||||||
}
|
}
|
||||||
if (settings.get_boolean('display-degree-sign')) {
|
if (settings.get_boolean('display-degree-sign')) {
|
||||||
@@ -406,8 +406,8 @@ let indicator;
|
|||||||
let event=null;
|
let event=null;
|
||||||
|
|
||||||
function enable() {
|
function enable() {
|
||||||
indicator = new CpuTemperature();
|
indicator = new Sensors();
|
||||||
Main.panel.addToStatusArea('temperature', indicator);
|
Main.panel.addToStatusArea('sensors', indicator);
|
||||||
//TODO catch preference change signals with settings.connect('changed::
|
//TODO catch preference change signals with settings.connect('changed::
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"description": "Shows CPU (and HDD) Temperature on Gnome Shell",
|
"description": "Shows CPU temperature, HDD temperature, voltage and fan RPM",
|
||||||
"name": "CPU Temperature Indicator",
|
"name": "Sensors",
|
||||||
"settings-schema": "org.gnome.shell.extensions.cpu-temperature",
|
"settings-schema": "org.gnome.shell.extensions.sensors",
|
||||||
"gettext-domain": "cpu-temperature",
|
"gettext-domain": "gse-sensors",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
"3.2",
|
"3.2",
|
||||||
"3.4",
|
"3.4",
|
||||||
"3.6"
|
"3.6"
|
||||||
],
|
],
|
||||||
"url": "http://motorscript.com/gnome-shell-extension-cpu-temperature/",
|
"url": "https://github.com/xtranophilist/gnome-shell-extension-sensors",
|
||||||
"uuid": "temperature@xtranophilist"
|
"uuid": "temperature@xtranophilist"
|
||||||
}
|
}
|
||||||
|
|||||||
10
prefs.js
10
prefs.js
@@ -5,7 +5,7 @@ const Gtk = imports.gi.Gtk;
|
|||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
|
|
||||||
|
|
||||||
const Gettext = imports.gettext.domain('cpu-temperature');
|
const Gettext = imports.gettext.domain('gse-sensors');
|
||||||
const _ = Gettext.gettext;
|
const _ = Gettext.gettext;
|
||||||
|
|
||||||
const ExtensionUtils = imports.misc.extensionUtils;
|
const ExtensionUtils = imports.misc.extensionUtils;
|
||||||
@@ -16,9 +16,9 @@ function init() {
|
|||||||
Convenience.initTranslations();
|
Convenience.initTranslations();
|
||||||
}
|
}
|
||||||
|
|
||||||
const CPUTemperaturePrefsWidget = new GObject.Class({
|
const SensorsPrefsWidget = new GObject.Class({
|
||||||
Name: 'CPUTemperature.Prefs.Widget',
|
Name: 'Sensors.Prefs.Widget',
|
||||||
GTypeName: 'CPUTemperaturePrefsWidget',
|
GTypeName: 'SensorsPrefsWidget',
|
||||||
Extends: Gtk.Grid,
|
Extends: Gtk.Grid,
|
||||||
|
|
||||||
_init: function(params) {
|
_init: function(params) {
|
||||||
@@ -217,7 +217,7 @@ const CPUTemperaturePrefsWidget = new GObject.Class({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function buildPrefsWidget() {
|
function buildPrefsWidget() {
|
||||||
let widget = new CPUTemperaturePrefsWidget();
|
let widget = new SensorsPrefsWidget();
|
||||||
widget.show_all();
|
widget.show_all();
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<schemalist gettext-domain="cpu-temperature">
|
<schemalist gettext-domain="gse-sensors">
|
||||||
|
|
||||||
<schema path="/org/gnome/shell/extensions/cpu-temperature/" id="org.gnome.shell.extensions.cpu-temperature">
|
<schema path="/org/gnome/shell/extensions/sensors/" id="org.gnome.shell.extensions.sensors">
|
||||||
|
|
||||||
<key type="i" name="update-time">
|
<key type="i" name="update-time">
|
||||||
<default>15</default>
|
<default>15</default>
|
||||||
Reference in New Issue
Block a user