This commit is contained in:
agryphus 2024-03-18 17:14:15 -04:00
parent 3648827637
commit c8d7b4c090
8 changed files with 415 additions and 0 deletions

View file

@ -0,0 +1,32 @@
const { exec, execAsync } = Utils;
export const Date = () => Widget.Button({
child: Widget.Label({
class_name: "module",
setup: (self) => {
self.poll(1000, (self) =>
execAsync(["date", "+ %a %b %e"])
.then((time) => (self.label = time))
.catch(console.error),
);
},
}),
on_clicked: () => {
},
});
export const Time = () => Widget.Button({
child: Widget.Label({
class_name: "module",
setup: (self) => {
self.poll(1000, (self) =>
execAsync(["date", "+ %R"])
.then((time) => (self.label = time))
.catch(console.error),
);
},
}),
on_clicked: () => {
},
});