13 lines
369 B
JavaScript
13 lines
369 B
JavaScript
import { Widget, Utils } from "../../imports.js";
|
|
const { execAsync } = Utils;
|
|
|
|
export const Clock = () => Widget.Button({
|
|
className: "clock",
|
|
setup: (self) => {
|
|
self.poll(1000, (self) =>
|
|
execAsync(["date", "+%a %b %d %H:%M"])
|
|
.then((time) => (self.label = time))
|
|
.catch(console.error),
|
|
);
|
|
},
|
|
});
|