diff options
author | noname <[email protected]> | 2025-03-07 17:28:55 +1100 |
---|---|---|
committer | noname <[email protected]> | 2025-03-07 17:28:55 +1100 |
commit | f77586bd467ac9d15068f6edfd6a1b856273c878 (patch) | |
tree | 4f1b6f6f3cc2a4a5003610c311669426505a2469 | |
parent | a15e80e56b14df97800f41384e60f7f5cb88c4ad (diff) |
add init function
-rw-r--r-- | lib/sway/sway.vala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/sway/sway.vala b/lib/sway/sway.vala index dd10824..2fa4c0e 100644 --- a/lib/sway/sway.vala +++ b/lib/sway/sway.vala @@ -14,13 +14,10 @@ namespace AstalSway { return _instance; } - var s = new Sway(); - var ipc = new Ipc(); + var s = new Sway(); try { - ipc.init(); - s.ipc = ipc; - s.subscribe.begin(); + s.init(); _instance = s; return s; } catch (Error err) { @@ -30,6 +27,12 @@ namespace AstalSway { } + private void init() throws Error { + ipc = new Ipc(); + ipc.init(); + subscribe.begin(() => sync_tree.begin()); + } + public Workspace focused_workspace; public Output focused_output; public Container? focused_container; |