init
This commit is contained in:
21
packages/ags/bk/services/clock.js
Normal file
21
packages/ags/bk/services/clock.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const { GLib } = imports.gi;
|
||||
class ClockService extends Service {
|
||||
static {
|
||||
Service.register ( this, {}, {
|
||||
'time': ['gobject']
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
#time = GLib.DateTime.new_now_local()
|
||||
|
||||
get time() { return this.#time; }
|
||||
constructor() {
|
||||
super()
|
||||
Utils.interval(1000, () => {
|
||||
this.#time = GLib.DateTime.new_now_local()
|
||||
this.changed("time")
|
||||
})
|
||||
}
|
||||
}
|
||||
export default new ClockService()
|
||||
Reference in New Issue
Block a user