nixos-configs/devices/binto/config/ags/ts/bar/buttons/clock.ts

13 lines
355 B
TypeScript
Raw Normal View History

2023-11-27 15:50:20 -05:00
import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
export default () => Label({ class_name: 'clock' })
.poll(1000, (self) => {
2023-11-27 15:50:20 -05:00
const time = imports.gi.GLib
.DateTime.new_now_local();
2023-11-27 15:50:20 -05:00
self.label = time.format('%a. ') +
time.get_day_of_month() +
time.format(' %b. %H:%M');
});