ags: optimizations, add media and separator widgets

This commit is contained in:
retrozinndev
2025-01-23 14:06:33 -03:00
parent b533e830a0
commit 017619f62b
9 changed files with 151 additions and 31 deletions
+4 -3
View File
@@ -7,10 +7,11 @@ const hyprland = AstalHyprland.get_default();
export function FocusedWindow() {
return new Widget.Box({
className: "focused-window",
visible: bind(hyprland, "focusedClient").as(Boolean),
children: [
new Widget.Icon({
className: "icon",
icon: bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) => {
icon: bind(hyprland, "focusedClient").as(Boolean) && bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) => {
switch(client.initialClass) {
case "zen":
return "zen-browser";
@@ -28,12 +29,12 @@ export function FocusedWindow() {
new Widget.Label({
className: "class",
xalign: 0,
label: bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) => client.get_class())
label: bind(hyprland, "focusedClient").as(Boolean) && bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) => client.get_class())
} as Widget.LabelProps),
new Widget.Label({
className: "title",
xalign: 0,
label: bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) => client.get_title())
label: bind(hyprland, "focusedClient").as(Boolean) && bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) => client.get_title())
} as Widget.LabelProps)
]
})