From 90019b99b671664855c1c53a30da39ca572f4a0e Mon Sep 17 00:00:00 2001 From: noname Date: Tue, 4 Mar 2025 22:27:31 +1100 Subject: implement containers and windows --- lib/sway/container.vala | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/sway/container.vala (limited to 'lib/sway/container.vala') diff --git a/lib/sway/container.vala b/lib/sway/container.vala new file mode 100644 index 0000000..04e676b --- /dev/null +++ b/lib/sway/container.vala @@ -0,0 +1,26 @@ +namespace AstalSway { + public class Container : Node { + public bool sticky; + public bool floating; + public string border; + public int border_width; + public int fullscreen_mode; + + public Container() { + node_type = NodeType.CONTAINER; + } + + internal override void sync(Json.Object obj) { + border = obj.get_string_member("border"); + border_width = (int)obj.get_int_member("current_border_width"); + sticky = obj.get_boolean_member("sticky"); + floating = obj.get_string_member("type") == "floating_con"; + fullscreen_mode = (int)obj.get_int_member("fullscreen_mode"); + base.sync(obj); + } + + public override void focus() { + Sway.get_default().run_command(@"[con_id=$id] focus"); + } + } +} -- cgit v1.2.3