ags: lot of stuff lmao
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { bind, Process } from "astal";
|
||||
import { Widget } from "astal/gtk3";
|
||||
import AstalWp from "gi://AstalWp";
|
||||
import { Wireplumber } from "../../scripts/volume";
|
||||
import { ControlCenter } from "../../window/ControlCenter";
|
||||
|
||||
const wp = AstalWp.get_default();
|
||||
|
||||
export function Audio() {
|
||||
return wp && new Widget.EventBox({
|
||||
return new Widget.EventBox({
|
||||
className: bind(ControlCenter, "visible").as((visible: boolean) =>
|
||||
visible ? "audio open" : "audio"),
|
||||
onClick: () => Process.exec_async("astal toggle control-center", () => {}),
|
||||
|
||||
@@ -12,6 +12,8 @@ export function FocusedClient() {
|
||||
children: [
|
||||
new Widget.Icon({
|
||||
className: "icon",
|
||||
vexpand: true,
|
||||
css: ".icon { font-size: 18px; }",
|
||||
icon: bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) =>
|
||||
client ?
|
||||
(getAppIcon(client.initialClass) || client.initialClass)
|
||||
@@ -29,15 +31,15 @@ export function FocusedClient() {
|
||||
new Widget.Label({
|
||||
className: "class",
|
||||
xalign: 0,
|
||||
max_width_chars: 65,
|
||||
truncate: false,
|
||||
maxWidthChars: 50,
|
||||
truncate: true,
|
||||
label: bind(focusedClient, "class")
|
||||
} as Widget.LabelProps),
|
||||
new Widget.Label({
|
||||
className: "title",
|
||||
xalign: 0,
|
||||
max_width_chars: 48,
|
||||
truncate: false,
|
||||
maxWidthChars: 45,
|
||||
truncate: true,
|
||||
label: bind(focusedClient, "title")
|
||||
} as Widget.LabelProps)
|
||||
] : []
|
||||
|
||||
@@ -2,13 +2,14 @@ import { Widget } from "astal/gtk3";
|
||||
import AstalHyprland from "gi://AstalHyprland";
|
||||
|
||||
export function Logo() {
|
||||
return new Widget.Box({
|
||||
return new Widget.EventBox({
|
||||
onClickRelease: () => AstalHyprland.get_default().dispatch("exec", "anyrun"),
|
||||
className: "logo",
|
||||
//tooltipText: tr("bar.logo.tooltip"),
|
||||
child: new Widget.Button({
|
||||
onClick: () => AstalHyprland.get_default().dispatch("exec", "anyrun"),
|
||||
className: "nf",
|
||||
label: "",
|
||||
} as Widget.ButtonProps)
|
||||
} as Widget.BoxProps);
|
||||
child: new Widget.Box({
|
||||
child: new Widget.Label({
|
||||
className: "nf",
|
||||
label: "",
|
||||
} as Widget.LabelProps)
|
||||
} as Widget.BoxProps)
|
||||
} as Widget.EventBoxProps);
|
||||
}
|
||||
|
||||
@@ -82,12 +82,14 @@ export function Media(): Gtk.Widget {
|
||||
className: "player-icon nf",
|
||||
label: bind(players[0], "busName").as((busName: string) => {
|
||||
const playerName: string = busName.split('.')[busName.split('.').length-1];
|
||||
return playerIcons[playerName as keyof typeof playerIcons] || "";
|
||||
return playerIcons[playerName.toLowerCase() as keyof typeof playerIcons] || "";
|
||||
})
|
||||
} as Widget.LabelProps),
|
||||
new Widget.Label({
|
||||
className: "title",
|
||||
label: bind(players[0], "title").as((title: string) => title || "No Title")
|
||||
label: bind(players[0], "title").as((title: string) => title || "No Title"),
|
||||
maxWidthChars: 20,
|
||||
truncate: true
|
||||
} as Widget.LabelProps),
|
||||
Separator({
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
@@ -97,7 +99,9 @@ export function Media(): Gtk.Widget {
|
||||
} as SeparatorProps),
|
||||
new Widget.Label({
|
||||
className: "artist",
|
||||
label: bind(players[0], "artist").as((artist: string) => artist || "No Artist")
|
||||
label: bind(players[0], "artist").as((artist: string) => artist || "No Artist"),
|
||||
maxWidthChars: 18,
|
||||
truncate: true
|
||||
} as Widget.LabelProps)
|
||||
] : new Widget.Label({
|
||||
label: "Crazy to think this widget haven't disappeared yet!"
|
||||
|
||||
Reference in New Issue
Block a user