Add ags
This commit is contained in:
parent
3648827637
commit
c8d7b4c090
8 changed files with 415 additions and 0 deletions
32
misc/.config/ags/modules/bar/clock.js
Normal file
32
misc/.config/ags/modules/bar/clock.js
Normal 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: () => {
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue