feat(config): implement configurations

This commit is contained in:
retrozinndev
2025-06-26 15:12:24 -03:00
parent 0dce6a98a9
commit dece2776fe
5 changed files with 81 additions and 59 deletions
+3 -3
View File
@@ -2,6 +2,7 @@ import { Gtk, Widget } from "astal/gtk3";
import { getDateTime } from "../../scripts/time";
import { bind, GLib } from "astal";
import { Windows } from "../../windows";
import { Config } from "../../scripts/config";
export function Clock(): Gtk.Widget {
return new Widget.Box({
@@ -9,9 +10,8 @@ export function Clock(): Gtk.Widget {
Object.hasOwn(openWins, "center-window") ? "open clock" : "clock"),
child: new Widget.Button({
onClick: () => Windows.toggle("center-window"),
label: getDateTime().as((dateTime: GLib.DateTime) => {
return dateTime.format("%A %d, %H:%M")
})
label: getDateTime().as((dateTime: GLib.DateTime) =>
dateTime.format(Config.getDefault().getProperty("clock.date_format", "string") as string))
} as Widget.ButtonProps)
} as Widget.BoxProps);
}