ags: add ask popup, make notifications work(finally :3) and more improvements

This commit is contained in:
retrozinndev
2025-03-09 13:45:07 -03:00
parent 161c811841
commit 59ef5e4aa7
67 changed files with 2005 additions and 731 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
import { bind, Process } from "astal";
import { Widget } from "astal/gtk3";
import { Gtk, Widget } from "astal/gtk3";
import { Wireplumber } from "../../scripts/volume";
import { ControlCenter } from "../../window/ControlCenter";
export function Audio() {
export function Audio(): Gtk.Widget {
return new Widget.EventBox({
className: bind(ControlCenter, "visible").as((visible: boolean) =>
visible ? "audio open" : "audio"),
+2 -2
View File
@@ -1,10 +1,10 @@
import { Widget } from "astal/gtk3";
import { Gtk, Widget } from "astal/gtk3";
import { getDateTime } from "../../scripts/time";
import { bind, GLib } from "astal";
import { Windows } from "../../windows";
import { CenterWindow } from "../../window/CenterWindow";
export function Clock(): JSX.Element {
export function Clock(): Gtk.Widget {
return new Widget.Box({
className: bind(CenterWindow, "visible").as((visible: boolean) =>
visible ? "clock open" : "clock"),
+2
View File
@@ -31,6 +31,7 @@ export function FocusedClient(): Gtk.Widget {
new Widget.Label({
className: "class",
xalign: 0,
visible: bind(focusedClient, "class").as(Boolean),
maxWidthChars: 55,
truncate: true,
tooltipText: bind(focusedClient, "class").as((clientClass: string) =>
@@ -41,6 +42,7 @@ export function FocusedClient(): Gtk.Widget {
className: "title",
xalign: 0,
maxWidthChars: 50,
visible: bind(focusedClient, "title").as(Boolean),
truncate: true,
tooltipText: bind(focusedClient, "title").as((clientTitle: string) =>
clientTitle.length > 55 ? clientTitle : ""),
+3 -3
View File
@@ -1,14 +1,14 @@
import { Widget } from "astal/gtk3";
import { Gtk, Widget } from "astal/gtk3";
import AstalHyprland from "gi://AstalHyprland";
export function Logo() {
export function Logo(): Gtk.Widget {
return new Widget.EventBox({
onClickRelease: () => AstalHyprland.get_default().dispatch("exec", "anyrun"),
className: "logo",
child: new Widget.Box({
child: new Widget.Label({
className: "nf",
label: "",
label: ""
} as Widget.LabelProps)
} as Widget.BoxProps)
} as Widget.EventBoxProps);
+3 -2
View File
@@ -11,7 +11,7 @@ function menuFromModel(model: Gio.MenuModel, actionGroup: Gio.ActionGroup | null
return menu;
}
export function Tray() {
export function Tray(): Gtk.Widget {
return new Widget.Box({
className: "tray",
visible: bind(astalTray, "items").as((items: Array<AstalTray.TrayItem>) => items.length > 0),
@@ -29,9 +29,10 @@ export function Tray() {
tooltipMarkup: bind(item, "tooltipMarkup"),
onClick: (_, event: Astal.ClickEvent) => {
if(event.button === Astal.MouseButton.SECONDARY) {
item.about_to_show();
menu.popup_at_widget(_, Gdk.Gravity.NORTH, Gdk.Gravity.SOUTH_WEST, null);
} else if(event.button === Astal.MouseButton.PRIMARY)
item.secondary_activate(event.x, event.y);
item.activate(event.x, event.y);
},
halign: Gtk.Align.CENTER,
child: new Widget.Icon({
+2 -2
View File
@@ -1,10 +1,10 @@
import { bind } from "astal";
import { Gdk, Gtk, Widget } from "astal/gtk3";
import { Gtk, Widget } from "astal/gtk3";
import AstalHyprland from "gi://AstalHyprland";
const hyprland = AstalHyprland.get_default();
export function Workspaces() {
export function Workspaces(): Gtk.Widget {
const workspacesEventBox = new Widget.EventBox({
onScroll: (_, event) =>
event.delta_y > 0 ? hyprland.dispatch("workspace", "e-1") : hyprland.dispatch("workspace", "e+1"),