diff --git a/DeltatuneWls/Program.cs b/DeltatuneWls/Program.cs index e5dff12..84b7a42 100644 --- a/DeltatuneWls/Program.cs +++ b/DeltatuneWls/Program.cs @@ -1,3 +1,28 @@ -// See https://aka.ms/new-console-template for more information +using Gio; +using Gtk; +using ZwlrLayerShell; +using Application = Gtk.Application; -Console.WriteLine("Hello, World!"); \ No newline at end of file +if (!LayerShell.IsSupported()) +{ + Console.WriteLine("You must be running on a Wayland compositor that supports zwlr_layer_shell_v1"); + return 255; +} + +var application = Application.New("gay.pancakes.deltatune_wls", Gio.ApplicationFlags.FlagsNone); + +application.OnActivate += (sender, eventArgs) => +{ + var window = ApplicationWindow.New((Application)sender); + + LayerShell.InitForWindow(window); + LayerShell.SetNamespace(window, "deltatune-wls"); + LayerShell.SetLayer(window, Layer.Top); + LayerShell.SetAnchor(window, Edge.Left, true); + LayerShell.SetAnchor(window, Edge.Top, true); + LayerShell.SetMargin(window, 15); + + window.Present(); +}; + +return application.RunWithSynchronizationContext(null); \ No newline at end of file