pikabar/pika-hyprland-settings/etc/skel/.config/ags/widgets/clock.js
Window Managers Group b544cbd928 Initial commit
2024-11-17 15:45:46 +01:00

26 lines
685 B
JavaScript

const { Widget } = ags;
import { getFormattedTime, getFormattedDate } from '../lib.js';
export const Clock = () => Widget.Box({
vertical: true,
halign: 'end',
valign: 'center',
sensitive: true,
className: 'clock',
children: [
Widget.Label({
halign: 'end',
valign: 'center',
className: 'txt-norm txt',
connections: [[5000, label => label.label = getFormattedTime()]],
}),
Widget.Label({
halign: 'end',
valign: 'center',
className: 'txt-smallie txt',
connections: [[60000, label => label.label = getFormattedDate()]],
}),
],
});