♻️ refactor: reorganize windows and widgets in a modular way

plus, better code for bluetooth device pairing and connecting
This commit is contained in:
retrozinndev
2025-09-25 13:19:52 -03:00
parent 7f3e66cc71
commit ba83c673aa
37 changed files with 186 additions and 176 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ import { Clipboard } from "./modules/clipboard";
import { Config } from "./modules/config";
import { Gdk, Gtk } from "ags/gtk4";
import { createRoot, getScope } from "ags";
import { OSDModes, triggerOSD } from "./window/OSD";
import { OSDModes, triggerOSD } from "./window/osd";
import { programArgs, programInvocationName } from "system";
import { setConsoleLogDomain } from "console";
import { initPlayer } from "./modules/media";
+2 -2
View File
@@ -1,16 +1,16 @@
import { Gtk } from "ags/gtk4";
import { Wireplumber } from "./volume";
import { Windows } from "../windows";
import { restartInstance } from "./reload-handler";
import { timeout } from "ags/time";
import { Runner } from "../runner/Runner";
import { showWorkspaceNumber } from "../widget/bar/Workspaces";
import { showWorkspaceNumber } from "../window/bar/widgets/Workspaces";
import { playSystemBell } from "./utils";
import { player, setPlayer } from "./media";
import { generalConfig, Shell } from "../app";
import AstalIO from "gi://AstalIO";
import AstalMpris from "gi://AstalMpris";
import { Gtk } from "ags/gtk4";
export type RemoteCaller = {
+5
View File
@@ -32,6 +32,11 @@ export class Bluetooth extends GObject.Object {
createRoot((_) => {
this.#scope = getScope();
if(this.astalBl.adapters.length > 0) {
this.#isAvailable = true;
this.notify("is-available");
}
this.#connections.set(
AstalBluetooth.get_default(),
AstalBluetooth.get_default().connect("adapter-added", (self, adapter) => {
@@ -1,11 +1,11 @@
import { Astal, Gdk, Gtk } from "ags/gtk4";
import { execApp, getAppIcon, getApps, getAstalApps } from "../modules/apps";
import { getPopupWindowContainer, PopupWindow } from "../widget/PopupWindow";
import { execApp, getAppIcon, getApps, getAstalApps } from "../../modules/apps";
import { getPopupWindowContainer, PopupWindow } from "../../widget/PopupWindow";
import AstalApps from "gi://AstalApps";
import Pango from "gi://Pango?version=1.0";
import { createState, For } from "ags";
import { escapeUnintendedMarkup } from "../modules/utils";
import { escapeUnintendedMarkup } from "../../modules/utils";
const ignoredKeys = [
@@ -1,11 +1,11 @@
import { Astal, Gtk } from "ags/gtk4";
import { Tray } from "../widget/bar/Tray";
import { Workspaces } from "../widget/bar/Workspaces";
import { FocusedClient } from "../widget/bar/FocusedClient";
import { Apps } from "../widget/bar/Apps";
import { Clock } from "../widget/bar/Clock";
import { Status } from "../widget/bar/Status";
import { Media } from "../widget/bar/Media";
import { Tray } from "./widgets/Tray";
import { Workspaces } from "./widgets/Workspaces";
import { FocusedClient } from "./widgets/FocusedClient";
import { Apps } from "./widgets/Apps";
import { Clock } from "./widgets/Clock";
import { Status } from "./widgets/Status";
import { Media } from "./widgets/Media";
export const Bar = (mon: number) => {
@@ -1,7 +1,8 @@
import { Gtk } from "ags/gtk4";
import { Windows } from "../../windows";
import { Windows } from "../../../windows";
import { createBinding } from "ags";
import { tr } from "../../i18n/intl";
import { tr } from "../../../i18n/intl";
export const Apps = () =>
<Gtk.Button class={createBinding(Windows.getDefault(), "openWindows").as((openWindows) =>
@@ -1,8 +1,8 @@
import { Gtk } from "ags/gtk4";
import { Windows } from "../../windows";
import { Windows } from "../../../windows";
import { createBinding } from "ags";
import { time } from "../../modules/utils";
import { generalConfig } from "../../app";
import { time } from "../../../modules/utils";
import { generalConfig } from "../../../app";
export const Clock = () =>
@@ -1,7 +1,7 @@
import { Gtk } from "ags/gtk4";
import { createBinding, With } from "ags";
import { variableToBoolean } from "../../modules/utils";
import { getAppIcon, getSymbolicIcon } from "../../modules/apps";
import { variableToBoolean } from "../../../modules/utils";
import { getAppIcon, getSymbolicIcon } from "../../../modules/apps";
import Pango from "gi://Pango?version=1.0";
import AstalHyprland from "gi://AstalHyprland";
@@ -1,10 +1,10 @@
import { createBinding, onCleanup, With } from "ags";
import { Gtk } from "ags/gtk4";
import { Separator } from "../Separator";
import { Windows } from "../../windows";
import { Clipboard } from "../../modules/clipboard";
import { getPlayerIconFromBusName, variableToBoolean } from "../../modules/utils";
import { accessMediaUrl, player, setPlayer } from "../../modules/media";
import { Separator } from "../../../widget/Separator";
import { Windows } from "../../../windows";
import { Clipboard } from "../../../modules/clipboard";
import { getPlayerIconFromBusName, variableToBoolean } from "../../../modules/utils";
import { accessMediaUrl, player, setPlayer } from "../../../modules/media";
import GObject from "ags/gobject";
import AstalMpris from "gi://AstalMpris";
@@ -1,16 +1,16 @@
import { Gtk } from "ags/gtk4";
import { Wireplumber } from "../../modules/volume";
import { Notifications } from "../../modules/notifications";
import { Windows } from "../../windows";
import { Recording } from "../../modules/recording";
import { Wireplumber } from "../../../modules/volume";
import { Notifications } from "../../../modules/notifications";
import { Windows } from "../../../windows";
import { Recording } from "../../../modules/recording";
import { Accessor, createBinding, createComputed, With } from "ags";
import { time, variableToBoolean } from "../../modules/utils";
import { variableToBoolean } from "../../../modules/utils";
import { Bluetooth } from "../../../modules/bluetooth";
import GObject from "ags/gobject";
import AstalBluetooth from "gi://AstalBluetooth";
import AstalNetwork from "gi://AstalNetwork";
import AstalWp from "gi://AstalWp";
import { Bluetooth } from "../../modules/bluetooth";
export const Status = () =>
@@ -1,6 +1,6 @@
import { createBinding, createComputed, For, With } from "ags";
import { Gdk, Gtk } from "ags/gtk4";
import { variableToBoolean } from "../../modules/utils";
import { variableToBoolean } from "../../../modules/utils";
import GObject from "gi://GObject?version=2.0";
import AstalTray from "gi://AstalTray"
@@ -1,9 +1,9 @@
import { Gtk } from "ags/gtk4";
import { getAppIcon, getSymbolicIcon } from "../../modules/apps";
import { Separator } from "../Separator";
import { generalConfig } from "../../app";
import { getAppIcon, getSymbolicIcon } from "../../../modules/apps";
import { Separator } from "../../../widget/Separator";
import { generalConfig } from "../../../app";
import { createBinding, createComputed, createState, For, With } from "ags";
import { variableToBoolean } from "../../modules/utils";
import { variableToBoolean } from "../../../modules/utils";
import AstalHyprland from "gi://AstalHyprland";
@@ -1,12 +1,12 @@
import { Gdk, Gtk } from "ags/gtk4";
import { Separator } from "../widget/Separator";
import { PopupWindow } from "../widget/PopupWindow";
import { BigMedia } from "../widget/center-window/BigMedia";
import { time, variableToBoolean } from "../modules/utils";
import { Separator } from "../../widget/Separator";
import { PopupWindow } from "../../widget/PopupWindow";
import { BigMedia } from "./widgets/BigMedia";
import { time, variableToBoolean } from "../../modules/utils";
import { createBinding } from "ags";
import { player } from "../../modules/media";
import AstalMpris from "gi://AstalMpris";
import { player } from "../modules/media";
export const CenterWindow = (mon: number) =>
<PopupWindow namespace={"center-window"} marginTop={10} monitor={mon}
@@ -1,10 +1,10 @@
import { createBinding, For } from "ags";
import { register } from "ags/gobject";
import { Astal, Gtk } from "ags/gtk4";
import { Clipboard } from "../../modules/clipboard";
import { accessMediaUrl } from "../../modules/media";
import { player, setPlayer } from "../../modules/media";
import { pathToURI, variableToBoolean } from "../../modules/utils";
import { Clipboard } from "../../../modules/clipboard";
import { accessMediaUrl } from "../../../modules/media";
import { player, setPlayer } from "../../../modules/media";
import { pathToURI, variableToBoolean } from "../../../modules/utils";
import AstalMpris from "gi://AstalMpris";
import Pango from "gi://Pango?version=1.0";
@@ -1,9 +1,9 @@
import { Astal, Gtk } from "ags/gtk4";
import { PopupWindow } from "../widget/PopupWindow";
import { QuickActions } from "../widget/control-center/QuickActions";
import { NotifHistory } from "../widget/control-center/NotifHistory";
import { Tiles } from "../widget/control-center/Tiles";
import { Sliders } from "../widget/control-center/Sliders";
import { PopupWindow } from "../../widget/PopupWindow";
import { QuickActions } from "./widgets/QuickActions";
import { NotifHistory } from "./widgets/NotifHistory";
import { Tiles } from "./widgets/tiles";
import { Sliders } from "./widgets/Sliders";
export const ControlCenter = (mon: number) =>
@@ -1,9 +1,10 @@
import { Gtk } from "ags/gtk4";
import { HistoryNotification, Notifications } from "../../modules/notifications";
import { NotificationWidget } from "../Notification";
import { tr } from "../../i18n/intl";
import { HistoryNotification, Notifications } from "../../../modules/notifications";
import { NotificationWidget } from "../../../widget/Notification";
import { tr } from "../../../i18n/intl";
import { createBinding, For } from "ags";
import AstalNotifd from "gi://AstalNotifd?version=0.1";
import AstalNotifd from "gi://AstalNotifd";
export const NotifHistory = () =>
@@ -1,5 +1,5 @@
import { Gtk } from "ags/gtk4";
import { Separator } from "../../Separator";
import { Separator } from "../../../widget/Separator";
import { Accessor, createRoot } from "ags";
import { transformWidget, variableToBoolean, WidgetNodeType } from "../../../modules/utils";
@@ -1,7 +1,7 @@
import { Gtk } from "ags/gtk4";
import { Windows } from "../../windows";
import { Wallpaper } from "../../modules/wallpaper";
import { execApp } from "../../modules/apps";
import { Windows } from "../../../windows";
import { Wallpaper } from "../../../modules/wallpaper";
import { execApp } from "../../../modules/apps";
import { Accessor } from "ags";
import { createPoll } from "ags/time";
@@ -1,13 +1,13 @@
import { Astal, Gtk } from "ags/gtk4";
import { Wireplumber } from "../../modules/volume";
import { Pages } from "./Pages";
import { Wireplumber } from "../../../modules/volume";
import { Pages } from "./pages";
import { PageSound } from "./pages/Sound";
import { PageMicrophone } from "./pages/Microphone";
import { createBinding, With } from "ags";
import { Backlights } from "../../modules/backlight";
import { Backlights } from "../../../modules/backlight";
import { PageBacklight } from "./pages/Backlight";
import AstalWp from "gi://AstalWp";
import { PageBacklight } from "./pages/Backlight";
export let slidersPages: Pages|undefined;
@@ -1,10 +1,10 @@
import { Astal, Gtk } from "ags/gtk4";
import { tr } from "../../../i18n/intl";
import { Backlights } from "../../../modules/backlight";
import { Page, PageButton } from "./Page";
import { tr } from "../../../../i18n/intl";
import { Backlights } from "../../../../modules/backlight";
import { Page, PageButton } from "../Page";
import { createBinding, For, With } from "ags";
import { addSliderMarksFromMinMax } from "../../../modules/utils";
import { userData } from "../../../app";
import { addSliderMarksFromMinMax } from "../../../../modules/utils";
import { userData } from "../../../../app";
export const PageBacklight = new Page({
@@ -1,16 +1,17 @@
import { Gtk } from "ags/gtk4";
import { Page, PageButton } from "./Page";
import { tr } from "../../../i18n/intl";
import { Windows } from "../../../windows";
import { Notifications } from "../../../modules/notifications";
import { execApp } from "../../../modules/apps";
import { Page, PageButton } from "../Page";
import { tr } from "../../../../i18n/intl";
import { Windows } from "../../../../windows";
import { Notifications } from "../../../../modules/notifications";
import { execApp } from "../../../../modules/apps";
import { execAsync } from "ags/process";
import { createBinding, createComputed, For, With } from "ags";
import { Bluetooth } from "../../../modules/bluetooth";
import { Bluetooth } from "../../../../modules/bluetooth";
import AstalNotifd from "gi://AstalNotifd";
import AstalBluetooth from "gi://AstalBluetooth";
import Adw from "gi://Adw?version=1";
import Gio from "gi://Gio?version=2.0";
export const BluetoothPage = new Page({
@@ -122,6 +123,13 @@ export const BluetoothPage = new Page({
});
function DeviceWidget({ device }: { device: AstalBluetooth.Device }): Gtk.Widget {
const pair = async () => {
if(device.paired) return;
device.pair();
device.set_trusted(true);
};
return <PageButton class={createBinding(device, "connected").as(conn =>
conn ? "selected" : "")} title={
createBinding(device, "alias").as(alias => alias ?? "Unknown Device")}
@@ -132,27 +140,28 @@ function DeviceWidget({ device }: { device: AstalBluetooth.Device }): Gtk.Widget
} actionClicked={() => {
if(device.connected) return;
let skipConnection: boolean = false;
if(!device.paired)
(async () => device.pair())().catch((err: Error) => {
skipConnection = true;
Notifications.getDefault().sendNotification({
appName: "bluetooth",
summary: "Device pairing error",
body: `Couldn't connect to ${device.alias ?? device.name}, an error occurred: ${err.message || err.stack}`,
urgency: AstalNotifd.Urgency.NORMAL
})
}).then(() => device.set_trusted(true));
pair().then(() => {
device.connect_device((_, res) => {
if(!skipConnection)
(async () => device.connect_device(null))().catch((err: Error) =>
Notifications.getDefault().sendNotification({
appName: "bluetooth",
summary: "Device connection error",
body: `Couldn't connect to ${device.alias ?? device.name}, an error occurred: ${err.message || err.stack}`,
urgency: AstalNotifd.Urgency.NORMAL
})
);
// get error
try { device.connect_device_finish(res); }
catch(e: any) {
Notifications.getDefault().sendNotification({
appName: "bluetooth",
summary: "Connection Error",
body: `An error occurred while attempting to connect to ${
device.alias ?? device.name}: ${(e as Gio.IOErrorEnum).message}`
});
}
});
}).catch((err: Gio.IOErrorEnum) =>
Notifications.getDefault().sendNotification({
appName: "bluetooth",
summary: "Pairing Error",
body: `Couldn't pair with ${device.alias ?? device.name}: ${err.message}`,
urgency: AstalNotifd.Urgency.NORMAL
})
);
}}
endWidget={<Gtk.Box spacing={6}>
<Adw.Spinner visible={createBinding(device, "connecting")} />
@@ -1,9 +1,9 @@
import { Page, PageButton } from "./Page";
import { Wireplumber } from "../../../modules/volume";
import { Page, PageButton } from "../Page";
import { Wireplumber } from "../../../../modules/volume";
import { Gtk } from "ags/gtk4";
import { tr } from "../../../i18n/intl";
import { tr } from "../../../../i18n/intl";
import { createBinding, For } from "ags";
import { lookupIcon } from "../../../modules/apps";
import { lookupIcon } from "../../../../modules/apps";
import AstalWp from "gi://AstalWp?version=0.1";
@@ -1,11 +1,11 @@
import { Gtk } from "ags/gtk4";
import { Page, PageButton } from "./Page";
import { Windows } from "../../../windows";
import { tr } from "../../../i18n/intl";
import { execApp } from "../../../modules/apps";
import { Notifications } from "../../../modules/notifications";
import { AskPopup, AskPopupProps } from "../../AskPopup";
import { encoder, variableToBoolean } from "../../../modules/utils";
import { Page, PageButton } from "../Page";
import { Windows } from "../../../../windows";
import { tr } from "../../../../i18n/intl";
import { execApp } from "../../../../modules/apps";
import { Notifications } from "../../../../modules/notifications";
import { AskPopup, AskPopupProps } from "../../../../widget/AskPopup";
import { encoder, variableToBoolean } from "../../../../modules/utils";
import { createBinding, For, With } from "ags";
import GLib from "gi://GLib?version=2.0";
@@ -1,8 +1,8 @@
import { Page } from "./Page";
import { NightLight } from "../../../modules/nightlight";
import { tr } from "../../../i18n/intl";
import { Page } from "../Page";
import { NightLight } from "../../../../modules/nightlight";
import { tr } from "../../../../i18n/intl";
import { Astal, Gtk } from "ags/gtk4";
import { addSliderMarksFromMinMax } from "../../../modules/utils";
import { addSliderMarksFromMinMax } from "../../../../modules/utils";
import { createBinding } from "ags";
export const PageNightLight = new Page({
@@ -1,10 +1,10 @@
import { Page, PageButton } from "./Page";
import { Page, PageButton } from "../Page";
import { Astal, Gtk } from "ags/gtk4";
import { getAppIcon, lookupIcon } from "../../../modules/apps";
import { Wireplumber } from "../../../modules/volume";
import { tr } from "../../../i18n/intl";
import { getAppIcon, lookupIcon } from "../../../../modules/apps";
import { Wireplumber } from "../../../../modules/volume";
import { tr } from "../../../../i18n/intl";
import { createBinding, For } from "ags";
import { variableToBoolean } from "../../../modules/utils";
import { variableToBoolean } from "../../../../modules/utils";
import AstalWp from "gi://AstalWp";
import GObject from "gi://GObject?version=2.0";
@@ -1,6 +1,6 @@
import { register } from "ags/gobject";
import { Gtk } from "ags/gtk4";
import { Page } from "./pages/Page";
import { Page } from "../Page";
import { timeout } from "ags/time";
import AstalIO from "gi://AstalIO";
@@ -1,15 +1,15 @@
import { Tile } from "./Tile";
import AstalBluetooth from "gi://AstalBluetooth";
import { BluetoothPage } from "../pages/Bluetooth";
import { TilesPages } from "../Tiles";
import { TilesPages } from "../tiles";
import { createBinding, createComputed } from "ags";
import { Bluetooth } from "../../../modules/bluetooth";
import { Bluetooth } from "../../../../modules/bluetooth";
import AstalBluetooth from "gi://AstalBluetooth";
export const TileBluetooth = () =>
<Tile title={"Bluetooth"} visible={
createBinding(Bluetooth.getDefault(), "adapter").as(Boolean)
} description={createBinding(AstalBluetooth.get_default(), "isConnected").as((connected) => {
<Tile title={"Bluetooth"} visible={createBinding(Bluetooth.getDefault(), "isAvailable")}
description={createBinding(AstalBluetooth.get_default(), "adapters").as((connected) => {
if(!connected) return "";
const connectedDevs = AstalBluetooth.get_default().devices.filter(dev => dev.connected);
@@ -1,6 +1,6 @@
import { Notifications } from "../../../modules/notifications";
import { Notifications } from "../../../../modules/notifications";
import { Tile } from "./Tile";
import { tr } from "../../../i18n/intl";
import { tr } from "../../../../i18n/intl";
import { createBinding } from "ags";
export const TileDND = () =>
@@ -1,12 +1,14 @@
import { execAsync } from "ags/process";
import { Tile } from "./Tile";
import AstalNetwork from "gi://AstalNetwork";
import { PageNetwork } from "../pages/Network";
import { tr } from "../../../i18n/intl";
import { TilesPages } from "../Tiles";
import { tr } from "../../../../i18n/intl";
import { TilesPages } from "../tiles";
import { Gtk } from "ags/gtk4";
import { createBinding, createComputed, With } from "ags";
import AstalNetwork from "gi://AstalNetwork";
export const TileNetwork = () => <Gtk.Box>
<With value={createComputed([
createBinding(AstalNetwork.get_default(), "primary"),
@@ -1,11 +1,12 @@
import { Tile } from "./Tile";
import { NightLight } from "../../../modules/nightlight";
import { NightLight } from "../../../../modules/nightlight";
import { PageNightLight } from "../pages/NightLight";
import { tr } from "../../../i18n/intl";
import { TilesPages } from "../Tiles";
import { isInstalled } from "../../../modules/utils";
import { tr } from "../../../../i18n/intl";
import { TilesPages } from "../tiles";
import { isInstalled } from "../../../../modules/utils";
import { createBinding, createComputed } from "ags";
export const TileNightLight = () =>
<Tile title={tr("control_center.tiles.night_light.title")}
icon={"weather-clear-night-symbolic"}
@@ -1,7 +1,7 @@
import { Tile } from "./Tile";
import { Recording } from "../../../modules/recording";
import { tr } from "../../../i18n/intl";
import { isInstalled, time } from "../../../modules/utils";
import { Recording } from "../../../../modules/recording";
import { tr } from "../../../../i18n/intl";
import { isInstalled } from "../../../../modules/utils";
import { createBinding, createComputed } from "ags";
@@ -9,18 +9,12 @@ export const TileRecording = () =>
<Tile title={tr("control_center.tiles.recording.title")}
description={createComputed([
createBinding(Recording.getDefault(), "recording"),
time
], (recording, dateTime) => {
createBinding(Recording.getDefault(), "recordingTime")
], (recording, time) => {
if(!recording || !Recording.getDefault().startedAt)
return tr("control_center.tiles.recording.disabled_desc") || "Start recording";
const startedAtSeconds = dateTime.to_unix() - Recording.getDefault().startedAt!;
if(startedAtSeconds <= 0) return "00:00";
const minutes = Math.floor(startedAtSeconds / 60);
const seconds = Math.floor(startedAtSeconds % 60);
return `${ minutes < 10 ? `0${minutes}` : minutes }:${ seconds < 10 ? `0${seconds}` : seconds }`;
return time;
})}
icon={"media-record-symbolic"}
visible={isInstalled("wf-recorder")}
@@ -1,15 +1,13 @@
import { Gtk } from "ags/gtk4";
import { createBinding } from "ags";
import { omitObjectKeys, variableToBoolean } from "../../../modules/utils";
import { omitObjectKeys, variableToBoolean } from "../../../../modules/utils";
import { property, register, signal } from "ags/gobject";
import Pango from "gi://Pango?version=1.0";
export { Tile };
@register({ GTypeName: "Tile" })
class Tile extends Gtk.Box {
export class Tile extends Gtk.Box {
@signal(Boolean) toggled(_state: boolean) {}
@signal() enabled() {}
@signal() disabled() {}
@@ -1,10 +1,10 @@
import { Gtk } from "ags/gtk4";
import { TileNetwork } from "./tiles/Network";
import { TileBluetooth } from "./tiles/Bluetooth";
import { TileDND } from "./tiles/DoNotDisturb";
import { TileRecording } from "./tiles/Recording";
import { TileNightLight } from "./tiles/NightLight";
import { Pages } from "./Pages";
import { TileNetwork } from "./Network";
import { TileBluetooth } from "./Bluetooth";
import { TileDND } from "./DoNotDisturb";
import { TileRecording } from "./Recording";
import { TileNightLight } from "./NightLight";
import { Pages } from "../pages";
export let TilesPages: Pages|undefined;
@@ -1,12 +1,13 @@
import { Astal, Gtk } from "ags/gtk4";
import { createBinding, createComputed, For } from "ags";
import { Notifications } from "../modules/notifications";
import { NotificationWidget } from "../widget/Notification";
import { generalConfig } from "../app";
import { Notifications } from "../../modules/notifications";
import { NotificationWidget } from "../../widget/Notification";
import { generalConfig } from "../../app";
import AstalNotifd from "gi://AstalNotifd";
import Adw from "gi://Adw?version=1";
const size = 450;
export const FloatingNotifications = (mon: number) =>
@@ -1,10 +1,10 @@
import { Astal, Gdk, Gtk } from "ags/gtk4";
import { execAsync } from "ags/process";
import { generalConfig } from "../app";
import { AskPopup } from "../widget/AskPopup";
import { Notifications } from "../modules/notifications";
import { NightLight } from "../modules/nightlight";
import { time } from "../modules/utils";
import { generalConfig } from "../../app";
import { AskPopup } from "../../widget/AskPopup";
import { Notifications } from "../../modules/notifications";
import { NightLight } from "../../modules/nightlight";
import { time } from "../../modules/utils";
import GObject from "ags/gobject";
import AstalNotifd from "gi://AstalNotifd";
@@ -1,9 +1,9 @@
import { Astal, Gtk } from "ags/gtk4";
import { Accessor, createBinding, createState, With } from "ags";
import { Wireplumber } from "../modules/volume";
import { Windows } from "../windows";
import { Backlights } from "../modules/backlight";
import { construct, variableToBoolean } from "../modules/utils";
import { Wireplumber } from "../../modules/volume";
import { Windows } from "../../windows";
import { Backlights } from "../../modules/backlight";
import { construct, variableToBoolean } from "../../modules/utils";
import GObject, { ParamSpec, property, register } from "ags/gobject";
import Pango from "gi://Pango?version=1.0";
+10 -12
View File
@@ -1,21 +1,19 @@
import { Astal } from "ags/gtk4";
import { Bar } from "./window/Bar";
import { variableToBoolean } from "./modules/utils";
import { OSD } from "./window/OSD";
import { ControlCenter } from "./window/ControlCenter";
import { FloatingNotifications } from "./window/FloatingNotifications";
import { CenterWindow } from "./window/CenterWindow";
import { LogoutMenu } from "./window/LogoutMenu";
import { AppsWindow } from "./window/AppsWindow";
import { createRoot, getScope, onCleanup } from "ags";
import { Shell } from "./app";
import GObject, { getter, register, signal } from "ags/gobject";
import { variableToBoolean } from "./modules/utils";
import { createRoot, getScope, onCleanup } from "ags";
import { Bar } from "./window/bar";
import { OSD } from "./window/osd";
import { ControlCenter } from "./window/control-center";
import { FloatingNotifications } from "./window/floating-notifications";
import { CenterWindow } from "./window/center-window";
import { LogoutMenu } from "./window/logout-menu";
import { AppsWindow } from "./window/apps-window";
import AstalHyprland from "gi://AstalHyprland";
export { Windows };
export type WindowInstance = { instance?: Astal.Window, connections: Array<number> };
export type WindowData = {
create: () => (Astal.Window | Array<Astal.Window>);
@@ -32,7 +30,7 @@ export type WindowData = {
* monitor, or all available monitors!
*/
@register({ GTypeName: "Windows" })
class Windows extends GObject.Object {
export class Windows extends GObject.Object {
private static instance: (Windows | null);
declare $signals: GObject.Object.SignalSignatures & {