nixos-configs/modules/ags/config/ts/bar/items/clock.ts
matt1432 7fd12f5b04
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(ags): update to new types
2024-01-22 10:23:32 -05:00

16 lines
492 B
TypeScript

import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
const { new_now_local } = imports.gi.GLib.DateTime;
export default () => Label({ class_name: 'clock' })
.poll(1000, (self) => {
const time = new_now_local();
const dayName = time.format('%a. ');
const dayNum = time.get_day_of_month();
const date = time.format(' %b. %H:%M');
if (dayNum && dayName && date) {
self.label = dayName + dayNum + date;
}
});