This repository has been archived on 2024-04-14. You can view files and clone it, but cannot push or open issues or pull requests.
nixos-dotfiles/user/configs/wayland/ags/ags-config/js/panel/widgets/clock.js

20 lines
547 B
JavaScript

import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
export default () => Box({
className: 'date',
children: [
Icon({
icon: 'x-office-calendar-symbolic',
}),
Label({
connections: [
[1000, label => execAsync(['date', '+%a %d, %B %H:%M'])
.then(date => label.label = ' ' + date).catch(console.error)
],
],
}),
],
});