forked from Shinonome/dots-hyprland
@@ -28,16 +28,27 @@ const BatBatteryProgress = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const time = Variable('', {
|
||||||
|
poll: [
|
||||||
|
userOptions.time.interval,
|
||||||
|
() => GLib.DateTime.new_now_local().format(userOptions.time.format),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
const date = Variable('', {
|
||||||
|
poll: [
|
||||||
|
userOptions.time.dateInterval,
|
||||||
|
() => GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
const BarClock = () => Widget.Box({
|
const BarClock = () => Widget.Box({
|
||||||
vpack: 'center',
|
vpack: 'center',
|
||||||
className: 'spacing-h-4 bar-clock-box',
|
className: 'spacing-h-4 bar-clock-box',
|
||||||
children: [
|
children: [
|
||||||
Widget.Label({
|
Widget.Label({
|
||||||
className: 'bar-time',
|
className: 'bar-time',
|
||||||
label: GLib.DateTime.new_now_local().format(userOptions.time.format),
|
label: time.bind(),
|
||||||
setup: (self) => self.poll(userOptions.time.interval, label => {
|
|
||||||
label.label = GLib.DateTime.new_now_local().format(userOptions.time.format);
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
Widget.Label({
|
Widget.Label({
|
||||||
className: 'txt-norm txt-onLayer1',
|
className: 'txt-norm txt-onLayer1',
|
||||||
@@ -45,10 +56,7 @@ const BarClock = () => Widget.Box({
|
|||||||
}),
|
}),
|
||||||
Widget.Label({
|
Widget.Label({
|
||||||
className: 'txt-smallie bar-date',
|
className: 'txt-smallie bar-date',
|
||||||
label: GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong),
|
label: date.bind(),
|
||||||
setup: (self) => self.poll(userOptions.time.dateInterval, (label) => {
|
|
||||||
label.label = GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong);
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user