mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2026-01-03 14:22:54 +00:00
refactor: make the whole thing more generic
This commit is contained in:
17
modules/home-manager/desktops/hyprland/ags/js/misc/Clock.js
Normal file
17
modules/home-manager/desktops/hyprland/ags/js/misc/Clock.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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,
|
||||
});
|
||||
Reference in New Issue
Block a user