pikabar/pika-hyprland-settings/etc/skel/.config/ags/widgets/clock.js

26 lines
685 B
JavaScript
Raw Normal View History

2024-11-17 15:45:46 +01:00
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()]],
}),
],
});