weather widget
This commit is contained in:
1 parent
44afecd7df
commit
54278273cb
14 files changed
+2688
-50
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import Service from 'resource:///com/github/Aylur/ags/service.js';
|
||||
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
|
||||
|
||||
class Weather extends Service {
|
||||
static { Service.register(this); }
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this._temperatureWeather = null;
|
||||
this._tooltip = null;
|
||||
}
|
||||
|
||||
get weatherData() {
|
||||
Utils.execAsync(['bash', '-c', "openweathermap ags"]).catch(print);
|
||||
}
|
||||
|
||||
get temperatureWeather() {
|
||||
return this._temperatureWeather;
|
||||
}
|
||||
setTemperatureWeather(temp) {
|
||||
this._temperatureWeather = temp;
|
||||
this.emit('changed');
|
||||
}
|
||||
|
||||
get tooltip() {
|
||||
return this._tooltip;
|
||||
}
|
||||
setTooltip(text) { this._tooltip = text }
|
||||
}
|
||||
|
||||
export default new Weather();
|
||||
Reference in new issue
Block a user