diff --git a/modules/ags/config/lib/hypr.ts b/modules/ags/config/lib/hypr.ts index b30ace75..ad032722 100644 --- a/modules/ags/config/lib/hypr.ts +++ b/modules/ags/config/lib/hypr.ts @@ -6,21 +6,23 @@ import AstalHyprland from 'gi://AstalHyprland'; export const get_hyprland_monitor = (monitor: Gdk.Monitor): AstalHyprland.Monitor | undefined => { const hyprland = AstalHyprland.get_default(); - const manufacturer = monitor.manufacturer?.replace(',', ''); - const model = monitor.model?.replace(',', ''); + const manufacturer = monitor.get_manufacturer()?.replace(',', ''); + const model = monitor.get_model()?.replace(',', ''); const start = `${manufacturer} ${model}`; - return hyprland.get_monitors().find((m) => m.description?.startsWith(start)); + return hyprland.get_monitors().find((m) => m.get_description()?.startsWith(start)); }; export const get_hyprland_monitor_desc = (monitor: Gdk.Monitor): string => { const hyprland = AstalHyprland.get_default(); - const manufacturer = monitor.manufacturer?.replace(',', ''); - const model = monitor.model?.replace(',', ''); + const manufacturer = monitor.get_manufacturer()?.replace(',', ''); + const model = monitor.get_model()?.replace(',', ''); const start = `${manufacturer} ${model}`; - return `desc:${hyprland.get_monitors().find((m) => m.description?.startsWith(start))?.description}`; + return `desc:${hyprland + .get_monitors() + .find((m) => m.get_description()?.startsWith(start))?.get_description()}`; }; export const get_gdkmonitor_from_desc = (desc: string): Gdk.Monitor => { @@ -38,7 +40,7 @@ export const get_gdkmonitor_from_desc = (desc: string): Gdk.Monitor => { }; export const get_monitor_desc = (mon: AstalHyprland.Monitor): string => { - return `desc:${mon.description}`; + return `desc:${mon.get_description()}`; }; export const hyprMessage = (message: string) => new Promise<string>(( @@ -66,25 +68,25 @@ export const centerCursor = (): void => { let y: number; const monitor = hyprland.get_focused_monitor(); - switch (monitor.transform) { + switch (monitor.get_transform()) { case 1: - x = monitor.x - (monitor.height / 2); - y = monitor.y - (monitor.width / 2); + x = monitor.get_x() - (monitor.get_height() / 2); + y = monitor.get_y() - (monitor.get_width() / 2); break; case 2: - x = monitor.x - (monitor.width / 2); - y = monitor.y - (monitor.height / 2); + x = monitor.get_x() - (monitor.get_width() / 2); + y = monitor.get_y() - (monitor.get_height() / 2); break; case 3: - x = monitor.x + (monitor.height / 2); - y = monitor.y + (monitor.width / 2); + x = monitor.get_x() + (monitor.get_height() / 2); + y = monitor.get_y() + (monitor.get_width() / 2); break; default: - x = monitor.x + (monitor.width / 2); - y = monitor.y + (monitor.height / 2); + x = monitor.get_x() + (monitor.get_width() / 2); + y = monitor.get_y() + (monitor.get_height() / 2); break; } diff --git a/modules/ags/config/lib/notify.ts b/modules/ags/config/lib/notify.ts index 3684be3c..3c29275b 100644 --- a/modules/ags/config/lib/notify.ts +++ b/modules/ags/config/lib/notify.ts @@ -18,7 +18,7 @@ interface NotifySendProps { urgency?: 'low' | 'normal' | 'critical' } -const escapeShellArg = (arg: string): string => `'${arg?.replace(/'/g, '\'\\\'\'')}'`; +const escapeShellArg = (arg: string | undefined): string => `'${arg?.replace(/'/g, '\'\\\'\'') ?? ''}'`; export const notifySend = ({ actions = [], diff --git a/modules/ags/config/widgets/applauncher/app-item.tsx b/modules/ags/config/widgets/applauncher/app-item.tsx index 419df209..e7ff2291 100644 --- a/modules/ags/config/widgets/applauncher/app-item.tsx +++ b/modules/ags/config/widgets/applauncher/app-item.tsx @@ -27,7 +27,7 @@ export class AppItem extends Widget.Box { const icon = ( <icon - icon={this.app.iconName} + icon={this.app.get_icon_name()} css="font-size: 42px; margin-right: 25px;" /> ); @@ -36,7 +36,7 @@ export class AppItem extends Widget.Box { <box vertical> <label className="title" - label={app.name} + label={app.get_name()} xalign={0} truncate valign={Gtk.Align.CENTER} @@ -45,7 +45,7 @@ export class AppItem extends Widget.Box { {app.description !== '' && ( <label className="description" - label={app.description} + label={app.get_description()} wrap xalign={0} justify={Gtk.Justification.LEFT} diff --git a/modules/ags/config/widgets/applauncher/index.tsx b/modules/ags/config/widgets/applauncher/index.tsx index 88818320..675b0921 100644 --- a/modules/ags/config/widgets/applauncher/index.tsx +++ b/modules/ags/config/widgets/applauncher/index.tsx @@ -16,10 +16,10 @@ export default () => SortedList({ create_row: (app) => <AppItem app={app} />, fzf_options: { - selector: (app) => app.name + app.executable, + selector: (app) => app.get_name() + app.get_executable(), tiebreakers: [ - (a, b) => b.item.frequency - a.item.frequency, + (a, b) => b.item.get_frequency() - a.item.get_frequency(), ], }, @@ -40,11 +40,11 @@ export default () => SortedList({ a.set_visible(true); b.set_visible(true); - return row2.frequency - row1.frequency; + return row2.get_frequency() - row1.get_frequency(); } else { - const s1 = fzfResults.find((r) => r.item.name === row1.name)?.score ?? 0; - const s2 = fzfResults.find((r) => r.item.name === row2.name)?.score ?? 0; + const s1 = fzfResults.find((r) => r.item.get_name() === row1.get_name())?.score ?? 0; + const s2 = fzfResults.find((r) => r.item.get_name() === row2.get_name())?.score ?? 0; a.set_visible(s1 !== 0); b.set_visible(s2 !== 0); diff --git a/modules/ags/config/widgets/applauncher/launch.ts b/modules/ags/config/widgets/applauncher/launch.ts index c519c9b4..de59122f 100644 --- a/modules/ags/config/widgets/applauncher/launch.ts +++ b/modules/ags/config/widgets/applauncher/launch.ts @@ -23,5 +23,6 @@ export const launchApp = (app: AstalApps.Application) => { .join(' '); bash(`${exe} &`); - app.frequency += 1; + + app.set_frequency(app.get_frequency() + 1); }; diff --git a/modules/ags/config/widgets/audio/profiles.tsx b/modules/ags/config/widgets/audio/profiles.tsx index 948b6515..e5cc2de1 100644 --- a/modules/ags/config/widgets/audio/profiles.tsx +++ b/modules/ags/config/widgets/audio/profiles.tsx @@ -6,7 +6,7 @@ import { ComboBoxText } from '../misc/subclasses'; export default (devices: AstalWp.Device[]) => devices - .sort((a, b) => a.description.localeCompare(b.description)) + .sort((a, b) => a.get_description().localeCompare(b.description)) .map((device) => ( <box className="stream" vertical> @@ -15,19 +15,19 @@ export default (devices: AstalWp.Device[]) => devices <ComboBoxText setup={(self) => { const profiles = (device.get_profiles() ?? []).sort((a, b) => { - if (a.description === 'Off') { + if (a.get_description() === 'Off') { return 1; } - else if (b.description === 'Off') { + else if (b.get_description() === 'Off') { return -1; } else { - return a.description.localeCompare(b.description); + return a.get_description().localeCompare(b.get_description()); } }); profiles.forEach((profile) => { - self.append(profile.index.toString(), profile.description); + self.append(profile.get_index().toString(), profile.get_description()); }); self.set_active( @@ -38,7 +38,11 @@ export default (devices: AstalWp.Device[]) => devices }} onChanged={(self) => { - device.set_active_profile(parseInt(self.activeId)); + const activeId = self.get_active_id(); + + if (activeId) { + device.set_active_profile(parseInt(activeId)); + } }} /> diff --git a/modules/ags/config/widgets/audio/streams.tsx b/modules/ags/config/widgets/audio/streams.tsx index 692f9ea7..b4332e73 100644 --- a/modules/ags/config/widgets/audio/streams.tsx +++ b/modules/ags/config/widgets/audio/streams.tsx @@ -11,7 +11,7 @@ export default (streams: AstalWp.Endpoint[]) => { let group: RadioButton | undefined; return streams - .sort((a, b) => a.description.localeCompare(b.description)) + .sort((a, b) => a.get_description().localeCompare(b.get_description())) .map((stream) => ( <box className="stream" vertical> @@ -29,14 +29,14 @@ export default (streams: AstalWp.Endpoint[]) => { self.group = group; } - self.active = stream.isDefault; + self.active = stream.get_is_default(); self.hook(stream, 'notify::is-default', () => { - self.active = stream.isDefault; + self.active = stream.get_is_default(); }); }} onButtonReleaseEvent={() => { - stream.isDefault = true; + stream.set_is_default(true); }} /> @@ -56,12 +56,12 @@ export default (streams: AstalWp.Endpoint[]) => { valign={Gtk.Align.END} onButtonReleaseEvent={() => { - stream.mute = !stream.mute; + stream.set_mute(!stream.get_mute()); }} > <icon icon={bind(stream, 'mute').as((isMuted) => { - if (stream.mediaClass === AstalWp.MediaClass.AUDIO_MICROPHONE) { + if (stream.get_media_class() === AstalWp.MediaClass.AUDIO_MICROPHONE) { return isMuted ? 'audio-input-microphone-muted-symbolic' : 'audio-input-microphone-symbolic'; diff --git a/modules/ags/config/widgets/bar/items/audio.tsx b/modules/ags/config/widgets/bar/items/audio.tsx index a3e2a619..4b542f2d 100644 --- a/modules/ags/config/widgets/bar/items/audio.tsx +++ b/modules/ags/config/widgets/bar/items/audio.tsx @@ -7,7 +7,7 @@ import PopupWindow from '../../misc/popup-window'; export default () => { - const speaker = AstalWp.get_default()?.audio.default_speaker; + const speaker = AstalWp.get_default()?.get_audio()?.get_default_speaker(); if (!speaker) { throw new Error('Could not find default audio devices.'); @@ -26,7 +26,7 @@ export default () => { 'right', ); - win.visible = !win.visible; + win.set_visible(!win.get_visible()); }} > <overlay passThrough> diff --git a/modules/ags/config/widgets/bar/items/bluetooth.tsx b/modules/ags/config/widgets/bar/items/bluetooth.tsx index 58b85db3..ff69a78f 100644 --- a/modules/ags/config/widgets/bar/items/bluetooth.tsx +++ b/modules/ags/config/widgets/bar/items/bluetooth.tsx @@ -27,7 +27,7 @@ export default () => { 'right', ); - win.visible = !win.visible; + win.set_visible(!win.get_visible()); }} > {bind(bluetooth, 'isPowered').as((isPowered) => { @@ -38,7 +38,9 @@ export default () => { return ( <box> {bind(bluetooth, 'isConnected').as((isConnected) => { - const device = bluetooth.get_devices().find((dev) => dev.connected); + const device = bluetooth + .get_devices() + .find((dev) => dev.get_connected()); if (!isConnected || !device) { return (<icon icon="bluetooth-active-symbolic" />); diff --git a/modules/ags/config/widgets/bar/items/clock.tsx b/modules/ags/config/widgets/bar/items/clock.tsx index 4f52c84f..2489ffd1 100644 --- a/modules/ags/config/widgets/bar/items/clock.tsx +++ b/modules/ags/config/widgets/bar/items/clock.tsx @@ -38,13 +38,13 @@ export default () => { 'right', ); - win.visible = !win.visible; + win.set_visible(!win.get_visible()); }} setup={(self) => { App.connect('window-toggled', (_, win) => { - if (win.name === 'win-notif-center') { - self.toggleClassName('toggle-on', win.visible); + if (win.get_name() === 'win-notif-center') { + self.toggleClassName('toggle-on', win.get_visible()); } }); }} diff --git a/modules/ags/config/widgets/bar/items/current-client.tsx b/modules/ags/config/widgets/bar/items/current-client.tsx index 3472de46..a4068973 100644 --- a/modules/ags/config/widgets/bar/items/current-client.tsx +++ b/modules/ags/config/widgets/bar/items/current-client.tsx @@ -21,13 +21,13 @@ export default () => { const updateVars = ( client: AstalHyprland.Client | null = hyprland.get_focused_client(), ) => { - lastFocusedAddress = client ? client.address : null; + lastFocusedAddress = client ? client.get_address() : null; const app = applications.fuzzy_query( - client?.class ?? '', + client?.get_class() ?? '', )[0]; - const icon = app?.iconName; + const icon = app?.get_icon_name(); if (icon) { visibleIcon.set(true); @@ -37,7 +37,7 @@ export default () => { visibleIcon.set(false); } - focusedTitle.set(client?.title ?? ''); + focusedTitle.set(client?.get_title() ?? ''); const id = client?.connect('notify::title', (c) => { if (c.get_address() !== lastFocusedAddress) { c.disconnect(id); diff --git a/modules/ags/config/widgets/bar/items/current-icon.tsx b/modules/ags/config/widgets/bar/items/current-icon.tsx index b6f2dce5..b67cf286 100644 --- a/modules/ags/config/widgets/bar/items/current-icon.tsx +++ b/modules/ags/config/widgets/bar/items/current-icon.tsx @@ -18,10 +18,10 @@ export default () => { client: AstalHyprland.Client | null = hyprland.get_focused_client(), ) => { const app = applications.fuzzy_query( - client?.class ?? '', + client?.get_class() ?? '', )[0]; - const icon = app?.iconName; + const icon = app?.get_icon_name(); if (icon) { visibleIcon.set(true); diff --git a/modules/ags/config/widgets/bar/items/network.tsx b/modules/ags/config/widgets/bar/items/network.tsx index 733285df..bf349db3 100644 --- a/modules/ags/config/widgets/bar/items/network.tsx +++ b/modules/ags/config/widgets/bar/items/network.tsx @@ -28,7 +28,7 @@ export default () => { 'right', ); - win.visible = !win.visible; + win.set_visible(!win.get_visible()); }} > {bind(network, 'primary').as((primary) => { @@ -38,7 +38,7 @@ export default () => { else if (primary === AstalNetwork.Primary.WIFI) { const Wifi = network.get_wifi(); - if (!Wifi || Wifi.accessPoints.length === 0) { return; } + if (!Wifi || Wifi.get_access_points().length === 0) { return; } return ( <box> diff --git a/modules/ags/config/widgets/bar/items/notif-button.tsx b/modules/ags/config/widgets/bar/items/notif-button.tsx index 6a5b0156..0082aa54 100644 --- a/modules/ags/config/widgets/bar/items/notif-button.tsx +++ b/modules/ags/config/widgets/bar/items/notif-button.tsx @@ -27,13 +27,13 @@ export default () => { 'right', ); - win.visible = !win.visible; + win.set_visible(!win.get_visible()); }} setup={(self) => { App.connect('window-toggled', (_, win) => { - if (win.name === 'win-notif-center') { - self.toggleClassName('toggle-on', win.visible); + if (win.get_name() === 'win-notif-center') { + self.toggleClassName('toggle-on', win.get_visible()); } }); }} @@ -41,7 +41,7 @@ export default () => { <box> <icon icon={bind(notifications, 'notifications').as((notifs) => { - if (notifications.dontDisturb) { + if (notifications.get_dont_disturb()) { return 'notification-disabled-symbolic'; } else if (notifs.length > 0) { diff --git a/modules/ags/config/widgets/bar/items/tray.tsx b/modules/ags/config/widgets/bar/items/tray.tsx index 87ea5d19..d5705525 100644 --- a/modules/ags/config/widgets/bar/items/tray.tsx +++ b/modules/ags/config/widgets/bar/items/tray.tsx @@ -8,7 +8,7 @@ const SKIP_ITEMS = ['.spotify-wrapped']; const TrayItem = (item: AstalTray.TrayItem) => { if (item.iconThemePath) { - App.add_icons(item.iconThemePath); + App.add_icons(item.get_icon_theme_path()); } return ( @@ -43,7 +43,7 @@ export default () => { setup={(self) => { self .hook(tray, 'item-added', (_, item: string) => { - if (itemMap.has(item) || SKIP_ITEMS.includes(tray.get_item(item).title)) { + if (itemMap.has(item) || SKIP_ITEMS.includes(tray.get_item(item).get_title())) { return; } diff --git a/modules/ags/config/widgets/bar/items/workspaces.tsx b/modules/ags/config/widgets/bar/items/workspaces.tsx index c1a1baf5..b4987348 100644 --- a/modules/ags/config/widgets/bar/items/workspaces.tsx +++ b/modules/ags/config/widgets/bar/items/workspaces.tsx @@ -89,10 +89,10 @@ export default () => { .child as Widget.Box) .children as Widget.Revealer[]; - const currentIndex = indicators.findIndex((w) => w.name === currentId); + const currentIndex = indicators.findIndex((w) => w.get_name() === currentId); if (currentIndex >= 0) { - self.css = `margin-left: ${L_PADDING + (currentIndex * WS_WIDTH)}px`; + self.set_css(`margin-left: ${L_PADDING + (currentIndex * WS_WIDTH)}px`); } }; @@ -123,40 +123,40 @@ export default () => { <box setup={(self) => { const refresh = () => { - (self.children as Widget.Revealer[]).forEach((rev) => { - rev.reveal_child = false; + (self.get_children() as Widget.Revealer[]).forEach((rev) => { + rev.set_reveal_child(false); }); workspaces.forEach((ws) => { - ws.reveal_child = true; + ws.set_reveal_child(true); }); }; const updateWorkspaces = () => { Hyprland.get_workspaces().forEach((ws) => { - const currentWs = (self.children as Widget.Revealer[]) - .find((ch) => ch.name === ws.id.toString()); + const currentWs = (self.get_children() as Widget.Revealer[]) + .find((ch) => ch.get_name() === ws.get_id().toString()); - if (!currentWs && ws.id > 0) { - self.add(Workspace({ id: ws.id })); + if (!currentWs && ws.get_id() > 0) { + self.add(Workspace({ id: ws.get_id() })); } }); // Make sure the order is correct workspaces.forEach((workspace, i) => { - (workspace.get_parent() as Widget.Box) - .reorder_child(workspace, i); + (workspace.get_parent() as Widget.Box).reorder_child(workspace, i); }); }; const updateAll = () => { - workspaces = (self.children as Widget.Revealer[]) + workspaces = (self.get_children() as Widget.Revealer[]) .filter((ch) => { return Hyprland.get_workspaces().find((ws) => { - return ws.id.toString() === ch.name; + return ws.get_id().toString() === ch.get_name(); }); }) - .sort((a, b) => parseInt(a.name ?? '0') - parseInt(b.name ?? '0')); + .sort((a, b) => + parseInt(a.get_name() ?? '0') - parseInt(b.get_name() ?? '0')); updateWorkspaces(); refresh(); diff --git a/modules/ags/config/widgets/bluetooth/device.tsx b/modules/ags/config/widgets/bluetooth/device.tsx index c26aea20..5313781f 100644 --- a/modules/ags/config/widgets/bluetooth/device.tsx +++ b/modules/ags/config/widgets/bluetooth/device.tsx @@ -87,7 +87,7 @@ export default class DeviceWidget extends Widget.Revealer { dev.pair(); } else { - bluetooth.adapter.remove_device(dev); + bluetooth.get_adapter()?.remove_device(dev); } }} /> @@ -111,7 +111,7 @@ export default class DeviceWidget extends Widget.Revealer { <button cursor="pointer" onButtonReleaseEvent={() => { - rev.revealChild = !rev.revealChild; + rev.set_reveal_child(!rev.get_reveal_child()); }} > <box> @@ -155,7 +155,7 @@ export default class DeviceWidget extends Widget.Revealer { this.dev = dev; this.connect('realize', () => idle(() => { - this.revealChild = true; + this.set_reveal_child(true); })); }; }; diff --git a/modules/ags/config/widgets/bluetooth/main.tsx b/modules/ags/config/widgets/bluetooth/main.tsx index a30df1e6..963ef9dc 100644 --- a/modules/ags/config/widgets/bluetooth/main.tsx +++ b/modules/ags/config/widgets/bluetooth/main.tsx @@ -12,29 +12,29 @@ import DeviceWidget from './device'; const calculateDevSort = (dev: AstalBluetooth.Device) => { let value = 0; - if (dev.connected) { + if (dev.get_connected()) { value += 1000; } - if (dev.paired) { + if (dev.get_paired()) { value += 100; } - if (dev.blocked) { + if (dev.get_blocked()) { value += 10; } - if (dev.icon) { - if (dev.icon === 'audio-headset') { + if (dev.get_icon()) { + if (dev.get_icon() === 'audio-headset') { value += 9; } - if (dev.icon === 'audio-headphones') { + if (dev.get_icon() === 'audio-headphones') { value += 8; } - if (dev.icon === 'audio-card') { + if (dev.get_icon() === 'audio-card') { value += 7; } - if (dev.icon === 'computer') { + if (dev.get_icon() === 'computer') { value += 6; } - if (dev.icon === 'phone') { + if (dev.get_icon() === 'phone') { value += 5; } } @@ -58,13 +58,13 @@ export default () => { setup={(self) => { bluetooth.devices - .filter((dev) => dev.name) + .filter((dev) => dev.get_name()) .forEach((dev) => { self.add(<DeviceWidget dev={dev} />); }); self.hook(bluetooth, 'device-added', (_, dev) => { - if (dev.name) { + if (dev.get_name()) { self.add(<DeviceWidget dev={dev} />); self.invalidate_sort(); } @@ -78,11 +78,11 @@ export default () => { const devWidget = children.find((ch) => ch.dev === dev); if (devWidget) { - devWidget.revealChild = false; + devWidget.set_reveal_child(false); setTimeout(() => { devWidget.get_parent()?.destroy(); - }, devWidget.transitionDuration + 100); + }, devWidget.get_transition_duration() + 100); } }); @@ -92,7 +92,7 @@ export default () => { const sort = calculateDevSort(devB) - calculateDevSort(devA); - return sort !== 0 ? sort : devA.name.localeCompare(devB.name); + return sort !== 0 ? sort : devA.get_name().localeCompare(devB.get_name()); }); }} /> @@ -114,7 +114,7 @@ export default () => { setup={(self) => { self.connect('notify::active', () => { - bluetooth.adapter?.set_powered(self.active); + bluetooth.get_adapter()?.set_powered(self.active); }); }} /> @@ -133,10 +133,10 @@ export default () => { self.toggleClassName('active', self.active); if (self.active) { - bluetooth.adapter?.start_discovery(); + bluetooth.get_adapter()?.start_discovery(); } else { - bluetooth.adapter?.stop_discovery(); + bluetooth.get_adapter()?.stop_discovery(); } }} > diff --git a/modules/ags/config/widgets/greeter/index.tsx b/modules/ags/config/widgets/greeter/index.tsx index 472f17f4..db3659fe 100644 --- a/modules/ags/config/widgets/greeter/index.tsx +++ b/modules/ags/config/widgets/greeter/index.tsx @@ -64,7 +64,7 @@ export default (hyprpaper: InstanceType<typeof Process>) => { onActivate={(self) => { AstalGreet.login( dropdown.get_active_text() ?? '', - self.text || '', + self.get_text() || '', 'Hyprland', (_, res) => { try { @@ -77,7 +77,7 @@ export default (hyprpaper: InstanceType<typeof Process>) => { }, 500); } catch (error) { - response.label = JSON.stringify(error); + response.set_label(JSON.stringify(error)); } }, ); @@ -94,7 +94,7 @@ export default (hyprpaper: InstanceType<typeof Process>) => { setup={(self) => { centerCursor(); setTimeout(() => { - self.visible = true; + self.set_visible(true); password.grab_focus(); }, 1000); }} diff --git a/modules/ags/config/widgets/lockscreen/index.tsx b/modules/ags/config/widgets/lockscreen/index.tsx index 995c2eeb..3547df46 100644 --- a/modules/ags/config/widgets/lockscreen/index.tsx +++ b/modules/ags/config/widgets/lockscreen/index.tsx @@ -43,16 +43,16 @@ export default () => { const unlock = () => { blurBGs.forEach((b) => { - b.css = bgCSS({ + b.set_css(bgCSS({ w: b.geometry.w, h: 1, - }); + })); timeout(transition_duration / 2, () => { - b.css = bgCSS({ + b.set_css(bgCSS({ w: 1, h: 1, - }); + })); }); }); timeout(transition_duration, () => { @@ -86,8 +86,8 @@ export default () => { idle(() => { rev.geometry = { - w: monitor.geometry.width, - h: monitor.geometry.height, + w: monitor.get_geometry().width, + h: monitor.get_geometry().height, }; rev.css = bgCSS({ @@ -164,17 +164,17 @@ export default () => { onRealize={(self) => self.grab_focus()} onActivate={(self) => { - self.sensitive = false; + self.set_sensitive(false); - AstalAuth.Pam.authenticate(self.text ?? '', (_, task) => { + AstalAuth.Pam.authenticate(self.get_text() ?? '', (_, task) => { try { AstalAuth.Pam.authenticate_finish(task); unlock(); } catch (e) { - self.text = ''; - label.label = (e as Error).message; - self.sensitive = true; + self.set_text(''); + label.set_label((e as Error).message); + self.set_sensitive(true); } }); }} diff --git a/modules/ags/config/widgets/misc/popup-window.tsx b/modules/ags/config/widgets/misc/popup-window.tsx index f8cc7bb0..3fafee5b 100644 --- a/modules/ags/config/widgets/misc/popup-window.tsx +++ b/modules/ags/config/widgets/misc/popup-window.tsx @@ -87,7 +87,7 @@ export class PopupWindow extends Widget.Window { const monitor = this.gdkmonitor ?? this.get_display().get_monitor_at_point(alloc.x, alloc.y); - const transform = get_hyprland_monitor(monitor)?.transform; + const transform = get_hyprland_monitor(monitor)?.get_transform(); let width: number; diff --git a/modules/ags/config/widgets/misc/sorted-list.tsx b/modules/ags/config/widgets/misc/sorted-list.tsx index 2ba41efa..4c50497b 100644 --- a/modules/ags/config/widgets/misc/sorted-list.tsx +++ b/modules/ags/config/widgets/misc/sorted-list.tsx @@ -80,9 +80,12 @@ export class SortedList<T> { this.fzf_results = out; list.invalidate_sort(); - const visibleApplications = list.get_children().filter((row) => row.visible).length; + const visibleApplications = list + .get_children() + .filter((row) => row.get_visible()) + .length; - placeholder.reveal_child = visibleApplications <= 0; + placeholder.set_reveal_child(visibleApplications <= 0); }) .catch(() => { /**/ }); }; @@ -134,7 +137,7 @@ export class SortedList<T> { name={name} keymode={Astal.Keymode.ON_DEMAND} on_open={() => { - entry.text = ''; + entry.set_text(''); refreshItems(); centerCursor(); entry.grab_focus(); diff --git a/modules/ags/config/widgets/network/access-point.tsx b/modules/ags/config/widgets/network/access-point.tsx index 227d87b2..bc3e7c14 100644 --- a/modules/ags/config/widgets/network/access-point.tsx +++ b/modules/ags/config/widgets/network/access-point.tsx @@ -15,7 +15,7 @@ const apCommand = (ap: AstalNetwork.AccessPoint, cmd: string[]): void => { ap.get_ssid()!, ]).catch((e) => notifySend({ title: 'Network', - iconName: ap.iconName, + iconName: ap.get_icon_name(), body: (e as Error).message, actions: [ { diff --git a/modules/ags/config/widgets/notifs/center.tsx b/modules/ags/config/widgets/notifs/center.tsx index feb4f6f4..7dac643c 100644 --- a/modules/ags/config/widgets/notifs/center.tsx +++ b/modules/ags/config/widgets/notifs/center.tsx @@ -52,7 +52,7 @@ const NotificationList = () => { const notif = (self.get_children() as NotifGestureWrapper[]) .find((ch) => ch.id === id); - if (notif?.sensitive) { + if (notif?.get_sensitive()) { notif.slideAway('Right'); } }); diff --git a/modules/ags/config/widgets/notifs/gesture.tsx b/modules/ags/config/widgets/notifs/gesture.tsx index 40489298..fa17a86c 100644 --- a/modules/ags/config/widgets/notifs/gesture.tsx +++ b/modules/ags/config/widgets/notifs/gesture.tsx @@ -143,7 +143,7 @@ export class NotifGestureWrapper extends Widget.EventBox { return; } - revChild.css = side === 'Left' ? slideLeft : slideRight; + revChild.set_css(side === 'Left' ? slideLeft : slideRight); timeout(ANIM_DURATION - 100, () => { rev = this.get_child() as Widget.Revealer | null; @@ -265,21 +265,21 @@ export class NotifGestureWrapper extends Widget.EventBox { // Slide right if (offset > 0) { - self.css = ` + self.set_css(` opacity: 1; transition: none; margin-left: ${offset}px; margin-right: -${offset}px; - `; + `); } // Slide left else { offset = Math.abs(offset); - self.css = ` + self.set_css(` opacity: 1; transition: none; margin-right: ${offset}px; margin-left: -${offset}px; - `; + `); } // Put a threshold on if a click is actually dragging @@ -301,7 +301,7 @@ export class NotifGestureWrapper extends Widget.EventBox { this.slideAway(offset > 0 ? 'Right' : 'Left'); } else { - self.css = defaultStyle; + self.set_css(defaultStyle); this.dragging = false; this.setCursor('grab'); @@ -313,9 +313,9 @@ export class NotifGestureWrapper extends Widget.EventBox { } // Reverse of slideAway, so it started at squeeze, then we go to slide - self.css = this.slide_in_from === 'Left' ? + self.set_css(this.slide_in_from === 'Left' ? slideLeft : - slideRight; + slideRight); idle(() => { if (!notifications.get_notification(id)) { @@ -336,7 +336,7 @@ export class NotifGestureWrapper extends Widget.EventBox { } // Then we go to center - self.css = defaultStyle; + self.set_css(defaultStyle); if (this.is_popup) { timeout(ANIM_DURATION, () => { diff --git a/modules/ags/config/widgets/notifs/notification.tsx b/modules/ags/config/widgets/notifs/notification.tsx index c209e34f..47017fcc 100644 --- a/modules/ags/config/widgets/notifs/notification.tsx +++ b/modules/ags/config/widgets/notifs/notification.tsx @@ -69,7 +69,7 @@ const setupButton = (self: Gtk.Widget) => { if (!display) { return; } - self.window.set_cursor(Gdk.Cursor.new_from_name( + self.get_window()?.set_cursor(Gdk.Cursor.new_from_name( display, 'pointer', )); @@ -80,7 +80,7 @@ const setupButton = (self: Gtk.Widget) => { if (!display) { return; } - self.window.set_cursor(null); + self.get_window()?.set_cursor(null); }); }; @@ -127,7 +127,7 @@ export const Notification = ({ } }}*/ > - <box vertical className={`notification ${notifObj.urgency} widget`}> + <box vertical className={`notification ${notifObj.get_urgency()} widget`}> {/* Content */} <box> <NotifIcon notifObj={notifObj} /> @@ -146,8 +146,8 @@ export const Notification = ({ max_width_chars={24} truncate wrap - label={notifObj.summary} - use_markup={notifObj.summary.startsWith('<')} + label={notifObj.get_summary()} + use_markup={notifObj.get_summary().startsWith('<')} /> {/* Time */} @@ -155,7 +155,7 @@ export const Notification = ({ className="time" valign={Gtk.Align.CENTER} halign={Gtk.Align.END} - label={setTime(notifObj.time)} + label={setTime(notifObj.get_time())} /> {/* Close button */} @@ -180,7 +180,7 @@ export const Notification = ({ hexpand use_markup xalign={0} - label={notifObj.body} + label={notifObj.get_body()} wrap /> </box> diff --git a/modules/ags/config/widgets/on-screen-display/index.tsx b/modules/ags/config/widgets/on-screen-display/index.tsx index 23fbf15d..6fa4f97b 100644 --- a/modules/ags/config/widgets/on-screen-display/index.tsx +++ b/modules/ags/config/widgets/on-screen-display/index.tsx @@ -42,8 +42,8 @@ export default () => { globalThis.popup_osd = popup; const brightness = Brightness.get_default(); - const speaker = AstalWp.get_default()?.audio.default_speaker; - const microphone = AstalWp.get_default()?.audio.default_microphone; + const speaker = AstalWp.get_default()?.get_audio()?.get_default_speaker(); + const microphone = AstalWp.get_default()?.get_audio()?.get_default_microphone(); if (!speaker || !microphone) { throw new Error('Could not find default audio devices.'); diff --git a/modules/ags/config/widgets/on-screen-keyboard/gesture.ts b/modules/ags/config/widgets/on-screen-keyboard/gesture.ts index 7ba638f1..917c2945 100644 --- a/modules/ags/config/widgets/on-screen-keyboard/gesture.ts +++ b/modules/ags/config/widgets/on-screen-keyboard/gesture.ts @@ -42,20 +42,20 @@ export default (window: OskWindow) => { if (tablet.oskState) { window.setSlideDown(); - window.get_child().css = ` + window.get_child().set_css(` transition: margin-bottom ${ANIM_DURATION}ms cubic-bezier(0.36, 0, 0.66, -0.56); margin-bottom: 0px; - `; + `); } else { releaseAllKeys(); window.setSlideUp(); - window.get_child().css = ` + window.get_child().set_css(` transition: margin-bottom ${ANIM_DURATION}ms cubic-bezier(0.36, 0, 0.66, -0.56); margin-bottom: -${calculatedHeight}px; - `; + `); } }); @@ -91,23 +91,23 @@ export default (window: OskWindow) => { const offset = window.startY - currentY; if (offset < 0) { - window.get_child().css = ` + window.get_child().set_css(` transition: margin-bottom 0.5s ease-in-out; margin-bottom: -${calculatedHeight}px; - `; + `); return; } if (offset > calculatedHeight) { - window.get_child().css = ` + window.get_child().set_css(` margin-bottom: 0px; - `; + `); } else { - window.get_child().css = ` + window.get_child().set_css(` margin-bottom: ${offset - calculatedHeight}px; - `; + `); } }); }), @@ -125,17 +125,17 @@ export default (window: OskWindow) => { const offset = window.startY - currentY; if (offset > calculatedHeight) { - window.get_child().css = ` + window.get_child().set_css(` transition: margin-bottom 0.5s ease-in-out; margin-bottom: 0px; - `; + `); tablet.oskState = true; } else { - window.get_child().css = ` + window.get_child().set_css(` transition: margin-bottom 0.5s ease-in-out; margin-bottom: -${calculatedHeight}px; - `; + `); } window.startY = null; @@ -172,17 +172,17 @@ export default (window: OskWindow) => { const offset = window.startY - currentY; if (offset > 0) { - window.get_child().css = ` + window.get_child().set_css(` transition: margin-bottom 0.5s ease-in-out; margin-bottom: 0px; - `; + `); return; } - window.get_child().css = ` + window.get_child().set_css(` margin-bottom: ${offset}px; - `; + `); }); }), ); @@ -199,18 +199,18 @@ export default (window: OskWindow) => { const offset = window.startY - currentY; if (offset < -(calculatedHeight * 2 / 3)) { - window.get_child().css = ` + window.get_child().set_css(` transition: margin-bottom 0.5s ease-in-out; margin-bottom: -${calculatedHeight}px; - `; + `); tablet.oskState = false; } else { - window.get_child().css = ` + window.get_child().set_css(` transition: margin-bottom 0.5s ease-in-out; margin-bottom: 0px; - `; + `); } window.startY = null; diff --git a/modules/ags/config/widgets/on-screen-keyboard/keys.tsx b/modules/ags/config/widgets/on-screen-keyboard/keys.tsx index d2581b4e..d0b09368 100644 --- a/modules/ags/config/widgets/on-screen-keyboard/keys.tsx +++ b/modules/ags/config/widgets/on-screen-keyboard/keys.tsx @@ -148,9 +148,9 @@ const RegularKey = (key: Key) => { self .hook(Shift, () => { if (key.labelShift) { - self.label = Shift.get() ? + self.set_label(Shift.get() ? key.labelShift : - key.label; + key.label); } }) .hook(Caps, () => { @@ -161,18 +161,18 @@ const RegularKey = (key: Key) => { } if (key.labelShift && key.label.match(/[A-Za-z]/)) { - self.label = Caps.get() ? + self.set_label(Caps.get() ? key.labelShift : - key.label; + key.label); } }) .hook(AltGr, () => { if (key.labelAltGr) { self.toggleClassName('altgr', AltGr.get()); - self.label = AltGr.get() ? + self.set_label(AltGr.get() ? key.labelAltGr : - key.label; + key.label); } }); }} diff --git a/modules/ags/config/widgets/screenshot/index.tsx b/modules/ags/config/widgets/screenshot/index.tsx index ffd42c81..7ff517c2 100644 --- a/modules/ags/config/widgets/screenshot/index.tsx +++ b/modules/ags/config/widgets/screenshot/index.tsx @@ -27,7 +27,7 @@ export default () => { const windowList = <box vertical /> as Widget.Box; const updateWindows = async() => { - if (!App.get_window('win-screenshot')?.visible) { + if (!App.get_window('win-screenshot')?.get_visible()) { return; } @@ -77,11 +77,11 @@ export default () => { cursor="pointer" onButtonReleaseEvent={() => { - takeScreenshot(['-o', monitor.name]); + takeScreenshot(['-o', monitor.get_name()]); }} > <label - label={`${monitor.name}: ${monitor.description}`} + label={`${monitor.get_name()}: ${monitor.get_description()}`} truncate maxWidthChars={50} /> @@ -125,9 +125,9 @@ export default () => { onButtonReleaseEvent={() => { frozen = !frozen; - freezeIcon.icon = frozen ? + freezeIcon.set_icon(frozen ? 'checkbox-checked-symbolic' : - 'checkbox-symbolic'; + 'checkbox-symbolic'); }} > <box halign={Gtk.Align.CENTER}>