-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init then bundle then gjs gives error #239
Comments
I managed to do it by using GTK4LayerShell like below: const window = new Gtk.Window();
window.visible = true;
window.cssClasses = ["Bar"];
window.application = App;
window.set_child(
<centerbox cssName="centerbox">
<box hexpand halign={Gtk.Align.CENTER}>
<Workspaces />
</box>
<menubutton cssName="clockbutton" hexpand halign={Gtk.Align.CENTER}>
<label cssName="clocklabel" label={time()} />
<popover>
<Gtk.Calendar />
</popover>
</menubutton>
<box>
<SysTray />
</box>
</centerbox>,
); Then initialize a layer shell for this window : Gtk4LayerShell.init_for_window(window);
Gtk4LayerShell.set_layer(window, Gtk4LayerShell.Layer.TOP);
Gtk4LayerShell.auto_exclusive_zone_enable(window);
Gtk4LayerShell.set_monitor(window, gdkmonitor);
Gtk4LayerShell.set_anchor(window, Gtk4LayerShell.Edge.LEFT, true);
Gtk4LayerShell.set_anchor(window, Gtk4LayerShell.Edge.TOP, true);
Gtk4LayerShell.set_anchor(window, Gtk4LayerShell.Edge.RIGHT, true);
window.maximize();
window.realize();
return window
|
On nix, if you want to bundle, you'll have to write a derivation. The bundle command simply uses esbuild to output a single js file, it won't magically link libraries on Nix. Don't use the |
@ShadowS0ng you don't have to use Gtk4LayerShell directly, using |
Many thanks. I was going to suggest changing the docs with this info but it seems they've been clarified since the last time I looked 🙂 |
Steps:
nix shell github:aylur/ags
ags init --gtk 4
ags run app.ts --gtk4
works as expected)ags bundle app.ts bundled.js
(no errors)gjs -m bundled.js
That gives us
How do I fix this?
The text was updated successfully, but these errors were encountered: