Files
TheaninovOS/modules/home-manager/desktops/hyprland/ags/js/misc/Clock.js

18 lines
462 B
JavaScript

import { clock } from "../variables.js";
import Widget from "resource:///com/github/Aylur/ags/widget.js";
/**
* @param {import('types/widgets/label').Props & {
* format?: string,
* interval?: number,
* }} o
*/
export default ({ format = "%H:%M:%S %B %e. %A", ...rest } = {}) =>
Widget.Label({
class_name: "clock",
label: clock.bind("value").transform((time) => {
return time.format(format) || "wrong format";
}),
...rest,
});