feat: update system

This commit is contained in:
2024-02-07 14:25:34 +01:00
parent 3bfeb8e6fc
commit 09afd0bef6
67 changed files with 933 additions and 1347 deletions

View File

@@ -8,28 +8,26 @@ const DesktopClock = () =>
class_name: "clock-box-shadow",
child: Widget.CenterBox({
class_name: "clock-box",
children: [
Clock({
class_name: "clock",
hpack: "center",
format: "%H",
}),
Widget.Box({
class_name: "separator-box",
vertical: true,
hexpand: true,
hpack: "center",
children: [
Widget.Separator({ vpack: "center", vexpand: true }),
Widget.Separator({ vpack: "center", vexpand: true }),
],
}),
Clock({
class_name: "clock",
hpack: "center",
format: "%M",
}),
],
start_widget: Clock({
class_name: "clock",
hpack: "center",
format: "%H",
}),
center_widget: Widget.Box({
class_name: "separator-box",
vertical: true,
hexpand: true,
hpack: "center",
children: [
Widget.Separator({ vpack: "center", vexpand: true }),
Widget.Separator({ vpack: "center", vexpand: true }),
],
}),
end_widget: Clock({
class_name: "clock",
hpack: "center",
format: "%M",
}),
}),
});
@@ -40,21 +38,17 @@ const Desktop = () =>
vertical: true,
vexpand: true,
hexpand: true,
binds: [["visible", options.desktop.clock.enable]],
connections: [
[
options.desktop.clock.position,
(box) => {
const [hpack = "center", vpack = "center", offset = 64] =
options.desktop.clock.position.value.split(" ") || [];
visible: options.desktop.clock.enable.bind("value"),
setup: (self) =>
self.hook(options.desktop.clock.position, () => {
const [hpack = "center", vpack = "center", offset = 64] =
options.desktop.clock.position.value.split(" ") || [];
// @ts-expect-error
box.hpack = hpack;
box.vpack = vpack;
box.setCss(`margin: ${Number(offset)}px;`);
},
],
],
// @ts-expect-error
self.hpack = hpack;
self.vpack = vpack;
self.setCss(`margin: ${Number(offset)}px;`);
}),
children: [
DesktopClock(),
Clock({ format: "%B %e. %A", class_name: "date" }),
@@ -66,6 +60,7 @@ const Desktop = () =>
export default (monitor) =>
Widget.Window({
monitor,
keymode: "on-demand",
name: `desktop${monitor}`,
layer: "background",
class_name: "desktop",