sidebar: dashboard current desktop -> date

Put date instead of current desktop on dashboard
Date is more useful imo (especially for vertical bar)
This commit is contained in:
2 * r + 2 * t 2025-04-10 19:06:50 +10:00
parent aeec219e84
commit 7a0c4fe6b4
2 changed files with 9 additions and 7 deletions

View file

@ -156,7 +156,6 @@
.details { .details {
font-size: lib.s(14); font-size: lib.s(14);
color: scheme.$yellow;
@include lib.spacing(8, true); @include lib.spacing(8, true);
@ -166,8 +165,11 @@
margin-bottom: lib.s(10); margin-bottom: lib.s(10);
} }
.uptime { $-colours: scheme.$yellow, scheme.$blue;
color: scheme.$blue; @for $i from 1 through list.length($-colours) {
:nth-child(#{$i + 1}) {
color: list.nth($-colours, $i);
}
} }
} }
} }

View file

@ -1,5 +1,5 @@
import Players from "@/services/players"; import Players from "@/services/players";
import { osIcon, osId } from "@/utils/system"; import { bindCurrentTime, osIcon } from "@/utils/system";
import Slider from "@/widgets/slider"; import Slider from "@/widgets/slider";
import { bind, GLib, monitorFile, Variable } from "astal"; import { bind, GLib, monitorFile, Variable } from "astal";
import { Gtk } from "astal/gtk3"; import { Gtk } from "astal/gtk3";
@ -52,9 +52,9 @@ const User = () => {
{bind(hasFace).as(h => (h ? <box visible={false} /> : <FaceFallback />))} {bind(hasFace).as(h => (h ? <box visible={false} /> : <FaceFallback />))}
</box> </box>
<box vertical hexpand valign={Gtk.Align.CENTER} className="details"> <box vertical hexpand valign={Gtk.Align.CENTER} className="details">
<label xalign={0} className="name" label={`${osIcon} ${GLib.get_user_name()}`} /> <label truncate xalign={0} className="name" label={`${osIcon} ${GLib.get_user_name()}`} />
<label xalign={0} label={(GLib.getenv("XDG_CURRENT_DESKTOP") ?? osId).toUpperCase()} /> <label truncate xalign={0} label={bind(uptime)} onDestroy={() => uptime.drop()} />
<label truncate xalign={0} className="uptime" label={bind(uptime)} onDestroy={() => uptime.drop()} /> <label truncate xalign={0} label={bindCurrentTime("%A, %e %B")} />
</box> </box>
</box> </box>
); );