diff options
author | Aylur <[email protected]> | 2024-09-26 00:32:03 +0000 |
---|---|---|
committer | Aylur <[email protected]> | 2024-09-26 00:32:03 +0000 |
commit | 00738c9383472b9fd83d65785215c5a97a58159f (patch) | |
tree | d9f91a890f6a01886496a58f4bc761619f5df09d /examples/vala/simple-bar/app.in.vala | |
parent | d24e3e39526a88a00ca9e11f168d9c705a21d25a (diff) |
add: python example bar
Diffstat (limited to 'examples/vala/simple-bar/app.in.vala')
-rw-r--r-- | examples/vala/simple-bar/app.in.vala | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/examples/vala/simple-bar/app.in.vala b/examples/vala/simple-bar/app.in.vala index 1d61b3a..aece979 100644 --- a/examples/vala/simple-bar/app.in.vala +++ b/examples/vala/simple-bar/app.in.vala @@ -1,6 +1,11 @@ class App : Astal.Application { public static App instance; + public override void request (string msg, SocketConnection conn) { + print(@"$msg\n"); + Astal.write_sock.begin(conn, "hello"); + } + public override void activate () { foreach (var mon in this.monitors) add_window(new Bar(mon)); @@ -8,8 +13,17 @@ class App : Astal.Application { apply_css("@STYLE@"); } - public static int main() { - App.instance = new App(); - return App.instance.run(null); + public static void main(string[] args) { + var instance_name = "simple-bar"; + + App.instance = new App() { + instance_name = instance_name + }; + + if (App.instance.acquire_socket()) { + App.instance.run(null); + } else { + print(Astal.Application.send_message(instance_name, string.joinv(" ", args))); + } } } |