nixos-configs/config/ags/js/bar/clock.js

23 lines
511 B
JavaScript
Raw Normal View History

2023-09-05 19:22:54 -04:00
const { Box, Label } = ags.Widget;
const { execAsync } = ags.Utils;
const { DateTime } = imports.gi.GLib;
const ClockModule = ({
interval = 1000,
...props
}) => Label({
...props,
className: 'clock',
2023-09-05 19:57:34 -04:00
connections: [
[interval, label => {
var time = DateTime.new_now_local();
label.label = time.format('%a. ') + time.get_day_of_month() + time.format(' %b. %H:%M');
}],
],
2023-09-05 19:22:54 -04:00
});
export const Clock = Box({
className: 'toggle-off',
child: ClockModule({}),
});