home/natto/ags: init

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2024-06-01 17:59:52 +05:30
parent 00ea23f65c
commit c86fb8b6d3
37 changed files with 1658 additions and 33 deletions

View File

@@ -0,0 +1,42 @@
const time = Variable("", {
poll: [1000, 'date "+%H:%M:%S"'],
});
const getDate = () => " " + Utils.exec('date "+%a, %b %e"');
const date = Variable(getDate());
export default () => {
const revealer = Widget.Revealer({
revealChild: false,
transitionDuration: 300,
transition: "slide_left",
child: Widget.Label({
label: date.bind(),
}),
});
return Widget.EventBox({
cursor: "pointer",
setup: (self) => {
self.on("leave-notify-event", () => {
revealer.reveal_child = false;
});
self.on("enter-notify-event", () => {
date.value = getDate();
revealer.reveal_child = true;
});
},
child: Widget.Button({
className: "date-wrapper",
onPrimaryClick: () => App.toggleWindow("calendar-0"),
child: Widget.Box({
children: [
Widget.Label({
label: time.bind(),
}),
revealer,
],
}),
}),
});
};