From 70675926d3457b3948d52113f0fa271d788a99cb Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 26 Sep 2011 19:25:59 +0100 Subject: [PATCH] Implement support for the TYPE_GET_MARKS request, add ->get_marks sugar method --- lib/AnyEvent/I3.pm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/AnyEvent/I3.pm b/lib/AnyEvent/I3.pm index 36642643..979e0867 100644 --- a/lib/AnyEvent/I3.pm +++ b/lib/AnyEvent/I3.pm @@ -65,9 +65,10 @@ use constant TYPE_GET_WORKSPACES => 1; use constant TYPE_SUBSCRIBE => 2; use constant TYPE_GET_OUTPUTS => 3; use constant TYPE_GET_TREE => 4; +use constant TYPE_GET_MARKS => 5; our %EXPORT_TAGS = ( 'all' => [ - qw(i3 TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS TYPE_GET_TREE) + qw(i3 TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS TYPE_GET_TREE TYPE_GET_MARKS) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{all} } ); @@ -325,7 +326,7 @@ sub get_outputs { =head2 get_tree -Gets the layout tree from i3 (tree branch only). +Gets the layout tree from i3 (>= v4.0). my $tree = i3->get_tree->recv; say Dumper($tree); @@ -339,6 +340,21 @@ sub get_tree { $self->message(TYPE_GET_TREE) } +=head2 get_marks + +Gets all the window identifier marks from i3 (>= v4.1). + + my $marks = i3->get_marks->recv; + say Dumper($tree); + +=cut +sub get_marks { + my ($self) = @_; + + $self->_ensure_connection; + + $self->message(TYPE_GET_MARKS) +} =head2 command($content) -- 2.39.5