diff --git a/nixosModules/ags/v2/lib.ts b/nixosModules/ags/v2/lib.ts index 84fe0fee..62589f8f 100644 --- a/nixosModules/ags/v2/lib.ts +++ b/nixosModules/ags/v2/lib.ts @@ -4,7 +4,8 @@ import AstalHyprland from 'gi://AstalHyprland'; const Hyprland = AstalHyprland.get_default(); /* Types */ -import type { PopupWindow } from './widgets/misc/popup-window'; +import PopupWindow from './widgets/misc/popup-window'; + export interface Layer { address: string x: number diff --git a/nixosModules/ags/v2/services/monitor-clicks.ts b/nixosModules/ags/v2/services/monitor-clicks.ts index c207b9f1..67d8af1d 100644 --- a/nixosModules/ags/v2/services/monitor-clicks.ts +++ b/nixosModules/ags/v2/services/monitor-clicks.ts @@ -17,7 +17,7 @@ const ON_CLICK_TRIGGERS = [ ]; /* Types */ -import { PopupWindow } from '../widgets/misc/popup-window'; +import PopupWindow from '../widgets/misc/popup-window'; import { CursorPos, Layer, LayerResult } from '../lib'; diff --git a/nixosModules/ags/v2/widgets/applauncher/app-item.tsx b/nixosModules/ags/v2/widgets/applauncher/app-item.tsx index 52270b98..6c131934 100644 --- a/nixosModules/ags/v2/widgets/applauncher/app-item.tsx +++ b/nixosModules/ags/v2/widgets/applauncher/app-item.tsx @@ -62,4 +62,4 @@ export class AppItem extends Widget.Box { } } -export default (props: AppItemProps) => new AppItem(props); +export default AppItem; diff --git a/nixosModules/ags/v2/widgets/applauncher/main.tsx b/nixosModules/ags/v2/widgets/applauncher/main.tsx index 65df9e49..de9110c1 100644 --- a/nixosModules/ags/v2/widgets/applauncher/main.tsx +++ b/nixosModules/ags/v2/widgets/applauncher/main.tsx @@ -5,7 +5,7 @@ import AstalApps from 'gi://AstalApps'; import SortedList from '../misc/sorted-list'; import { launchApp } from './launch'; -import AppItemWidget, { AppItem } from './app-item'; +import AppItem from './app-item'; export default () => SortedList({ @@ -13,7 +13,7 @@ export default () => SortedList({ create_list: () => AstalApps.Apps.new().get_list(), - create_row: (app) => AppItemWidget({ app }), + create_row: (app) => , fzf_options: { selector: (app) => app.name + app.executable, diff --git a/nixosModules/ags/v2/widgets/bar/items/clock.tsx b/nixosModules/ags/v2/widgets/bar/items/clock.tsx index 4e528601..4f52c84f 100644 --- a/nixosModules/ags/v2/widgets/bar/items/clock.tsx +++ b/nixosModules/ags/v2/widgets/bar/items/clock.tsx @@ -2,7 +2,7 @@ import { bind, Variable } from 'astal'; import { App } from 'astal/gtk3'; import GLib from 'gi://GLib'; -import { PopupWindow } from '../../misc/popup-window'; +import PopupWindow from '../../misc/popup-window'; export default () => { diff --git a/nixosModules/ags/v2/widgets/bar/items/notif-button.tsx b/nixosModules/ags/v2/widgets/bar/items/notif-button.tsx index 3b76dde6..3e06d899 100644 --- a/nixosModules/ags/v2/widgets/bar/items/notif-button.tsx +++ b/nixosModules/ags/v2/widgets/bar/items/notif-button.tsx @@ -9,7 +9,7 @@ import Separator from '../../misc/separator'; const SPACING = 4; // Types -import { PopupWindow } from '../../misc/popup-window'; +import PopupWindow from '../../misc/popup-window'; export default () => ( diff --git a/nixosModules/ags/v2/widgets/clipboard/clip-item.tsx b/nixosModules/ags/v2/widgets/clipboard/clip-item.tsx index dea0f33b..aee0bda9 100644 --- a/nixosModules/ags/v2/widgets/clipboard/clip-item.tsx +++ b/nixosModules/ags/v2/widgets/clipboard/clip-item.tsx @@ -94,3 +94,5 @@ export class ClipItem extends Widget.Box { } } } + +export default ClipItem; diff --git a/nixosModules/ags/v2/widgets/clipboard/main.tsx b/nixosModules/ags/v2/widgets/clipboard/main.tsx index 29ebbc14..b3bf726c 100644 --- a/nixosModules/ags/v2/widgets/clipboard/main.tsx +++ b/nixosModules/ags/v2/widgets/clipboard/main.tsx @@ -28,7 +28,7 @@ export default () => SortedList({ }); }, - create_row: (item) => new ClipItem({ item }), + create_row: (item) => , fzf_options: { selector: (item) => item.content, diff --git a/nixosModules/ags/v2/widgets/misc/popup-window.tsx b/nixosModules/ags/v2/widgets/misc/popup-window.tsx index afceb7f4..89c15425 100644 --- a/nixosModules/ags/v2/widgets/misc/popup-window.tsx +++ b/nixosModules/ags/v2/widgets/misc/popup-window.tsx @@ -109,4 +109,4 @@ export class PopupWindow extends Widget.Window { } } -export default (props: PopupWindowProps) => new PopupWindow(props); +export default PopupWindow; diff --git a/nixosModules/ags/v2/widgets/misc/smooth-progress.tsx b/nixosModules/ags/v2/widgets/misc/smooth-progress.tsx index a32685b6..d5dad201 100644 --- a/nixosModules/ags/v2/widgets/misc/smooth-progress.tsx +++ b/nixosModules/ags/v2/widgets/misc/smooth-progress.tsx @@ -58,4 +58,4 @@ class SmoothProgress extends Widget.Box { } } -export default (props?: SmoothProgressProps) => new SmoothProgress(props); +export default SmoothProgress; diff --git a/nixosModules/ags/v2/widgets/misc/sorted-list.tsx b/nixosModules/ags/v2/widgets/misc/sorted-list.tsx index 94ac1928..6757e1be 100644 --- a/nixosModules/ags/v2/widgets/misc/sorted-list.tsx +++ b/nixosModules/ags/v2/widgets/misc/sorted-list.tsx @@ -6,7 +6,7 @@ import { idle } from 'astal'; import { AsyncFzf, FzfOptions, FzfResultItem } from 'fzf'; -import PopupWindow, { PopupWindow as PopupWindowClass } from '../misc/popup-window'; +import PopupWindow from '../misc/popup-window'; import { centerCursor } from '../../lib'; export interface SortedListProps { @@ -29,7 +29,7 @@ export class SortedList { private item_list: T[] = []; private fzf_results: FzfResultItem[] = []; - readonly window: PopupWindowClass; + readonly window: PopupWindow; private _item_map = new Map(); readonly create_list: () => T[] | Promise; @@ -171,7 +171,7 @@ export class SortedList { - ) as PopupWindowClass; + ) as PopupWindow; this.create_list = create_list; this.create_row = create_row; diff --git a/nixosModules/ags/v2/widgets/notifs/center.tsx b/nixosModules/ags/v2/widgets/notifs/center.tsx index 1bb4e160..70b20aa8 100644 --- a/nixosModules/ags/v2/widgets/notifs/center.tsx +++ b/nixosModules/ags/v2/widgets/notifs/center.tsx @@ -5,7 +5,7 @@ import AstalNotifd from 'gi://AstalNotifd'; const Notifications = AstalNotifd.get_default(); import { Notification, HasNotifs } from './notification'; -import { NotifGestureWrapper } from './gesture'; +import NotifGestureWrapper from './gesture'; const addNotif = (box: Widget.Box, notifObj: AstalNotifd.Notification) => { diff --git a/nixosModules/ags/v2/widgets/notifs/gesture.tsx b/nixosModules/ags/v2/widgets/notifs/gesture.tsx index 62b28793..1d2ddf2e 100644 --- a/nixosModules/ags/v2/widgets/notifs/gesture.tsx +++ b/nixosModules/ags/v2/widgets/notifs/gesture.tsx @@ -345,4 +345,4 @@ export class NotifGestureWrapper extends Widget.EventBox { } } -export default (props: NotifGestureWrapperProps) => new NotifGestureWrapper(props); +export default NotifGestureWrapper; diff --git a/nixosModules/ags/v2/widgets/notifs/notification.tsx b/nixosModules/ags/v2/widgets/notifs/notification.tsx index b84fb0ca..e54035dc 100644 --- a/nixosModules/ags/v2/widgets/notifs/notification.tsx +++ b/nixosModules/ags/v2/widgets/notifs/notification.tsx @@ -91,7 +91,7 @@ export const Notification = ({ id = 0, popup_timer = 0, slide_in_from = 'Left' as 'Left' | 'Right', -}): ReturnType | undefined => { +}): NotifGestureWrapper | undefined => { const notifObj = Notifications.get_notification(id); if (!notifObj) { @@ -201,5 +201,5 @@ export const Notification = ({ - ) as ReturnType; + ) as NotifGestureWrapper; }; diff --git a/nixosModules/ags/v2/widgets/notifs/popups.tsx b/nixosModules/ags/v2/widgets/notifs/popups.tsx index f8fa23be..25969cdb 100644 --- a/nixosModules/ags/v2/widgets/notifs/popups.tsx +++ b/nixosModules/ags/v2/widgets/notifs/popups.tsx @@ -1,7 +1,7 @@ import AstalNotifd from 'gi://AstalNotifd'; const Notifications = AstalNotifd.get_default(); -import { NotifGestureWrapper } from './gesture'; +import NotifGestureWrapper from './gesture'; import { Notification } from './notification'; diff --git a/nixosModules/ags/v2/widgets/osd/main.tsx b/nixosModules/ags/v2/widgets/osd/main.tsx index ef62ce0c..4e60f2a8 100644 --- a/nixosModules/ags/v2/widgets/osd/main.tsx +++ b/nixosModules/ags/v2/widgets/osd/main.tsx @@ -2,7 +2,7 @@ import { bind, timeout } from 'astal'; import { register } from 'astal/gobject'; import { App, Astal, astalify, Gtk, Widget, type ConstructProps } from 'astal/gtk3'; -import AstalWp from "gi://AstalWp" +import AstalWp from 'gi://AstalWp'; import PopupWindow from '../misc/popup-window'; import Brightness from '../../services/brightness'; @@ -17,7 +17,8 @@ class ProgressBar extends astalify(Gtk.ProgressBar) { ProgressBar, Gtk.ProgressBar.ConstructorProps >) { - super(props as any) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + super(props as any); } } @@ -46,12 +47,16 @@ export default () => { App.get_window('win-osd')?.set_visible(false); } }); - } + }; globalThis.popup_osd = popup; - const speaker = AstalWp.get_default()?.audio.default_speaker!; - const microphone = AstalWp.get_default()?.audio.default_microphone!; + const speaker = AstalWp.get_default()?.audio.default_speaker; + const microphone = AstalWp.get_default()?.audio.default_microphone; + + if (!speaker || !microphone) { + throw new Error('Could not find default audio devices.'); + } return (