mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-14 00:14:14 +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
|
||||
*~
|
||||
|
||||
16
extension.js
16
extension.js
@@ -13,19 +13,19 @@ const Shell = imports.gi.Shell;
|
||||
let settings;
|
||||
let metadata = Me.metadata;
|
||||
|
||||
function CpuTemperature() {
|
||||
function Sensors() {
|
||||
this._init.apply(this, arguments);
|
||||
}
|
||||
|
||||
CpuTemperature.prototype = {
|
||||
Sensors.prototype = {
|
||||
__proto__: PanelMenu.SystemStatusButton.prototype,
|
||||
|
||||
_init: function(){
|
||||
PanelMenu.SystemStatusButton.prototype._init.call(this, 'temperature');
|
||||
PanelMenu.SystemStatusButton.prototype._init.call(this, 'sensors');
|
||||
|
||||
this.statusLabel = new St.Label({
|
||||
text: "--",
|
||||
style_class: "temperature-label"
|
||||
style_class: "sensors-label"
|
||||
});
|
||||
|
||||
// destroy all previously created children, and add our statusLabel
|
||||
@@ -43,7 +43,7 @@ CpuTemperature.prototype = {
|
||||
if (display_hdd_temp){
|
||||
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){
|
||||
this.title='Error';
|
||||
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';
|
||||
if (!settings.get_boolean('display-decimal-value')){
|
||||
ret = Math.round(value);
|
||||
//ret = Math.round(value);
|
||||
format = '%d';
|
||||
}
|
||||
if (settings.get_boolean('display-degree-sign')) {
|
||||
@@ -406,8 +406,8 @@ let indicator;
|
||||
let event=null;
|
||||
|
||||
function enable() {
|
||||
indicator = new CpuTemperature();
|
||||
Main.panel.addToStatusArea('temperature', indicator);
|
||||
indicator = new Sensors();
|
||||
Main.panel.addToStatusArea('sensors', indicator);
|
||||
//TODO catch preference change signals with settings.connect('changed::
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"description": "Shows CPU (and HDD) Temperature on Gnome Shell",
|
||||
"name": "CPU Temperature Indicator",
|
||||
"settings-schema": "org.gnome.shell.extensions.cpu-temperature",
|
||||
"gettext-domain": "cpu-temperature",
|
||||
"description": "Shows CPU temperature, HDD temperature, voltage and fan RPM",
|
||||
"name": "Sensors",
|
||||
"settings-schema": "org.gnome.shell.extensions.sensors",
|
||||
"gettext-domain": "gse-sensors",
|
||||
"shell-version": [
|
||||
"3.2",
|
||||
"3.4",
|
||||
"3.6"
|
||||
],
|
||||
"url": "http://motorscript.com/gnome-shell-extension-cpu-temperature/",
|
||||
"url": "https://github.com/xtranophilist/gnome-shell-extension-sensors",
|
||||
"uuid": "temperature@xtranophilist"
|
||||
}
|
||||
}
|
||||
|
||||
10
prefs.js
10
prefs.js
@@ -5,7 +5,7 @@ const Gtk = imports.gi.Gtk;
|
||||
const Lang = imports.lang;
|
||||
|
||||
|
||||
const Gettext = imports.gettext.domain('cpu-temperature');
|
||||
const Gettext = imports.gettext.domain('gse-sensors');
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
@@ -16,9 +16,9 @@ function init() {
|
||||
Convenience.initTranslations();
|
||||
}
|
||||
|
||||
const CPUTemperaturePrefsWidget = new GObject.Class({
|
||||
Name: 'CPUTemperature.Prefs.Widget',
|
||||
GTypeName: 'CPUTemperaturePrefsWidget',
|
||||
const SensorsPrefsWidget = new GObject.Class({
|
||||
Name: 'Sensors.Prefs.Widget',
|
||||
GTypeName: 'SensorsPrefsWidget',
|
||||
Extends: Gtk.Grid,
|
||||
|
||||
_init: function(params) {
|
||||
@@ -217,7 +217,7 @@ const CPUTemperaturePrefsWidget = new GObject.Class({
|
||||
});
|
||||
|
||||
function buildPrefsWidget() {
|
||||
let widget = new CPUTemperaturePrefsWidget();
|
||||
let widget = new SensorsPrefsWidget();
|
||||
widget.show_all();
|
||||
return widget;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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">
|
||||
<default>15</default>
|
||||
Reference in New Issue
Block a user