diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2010-11-21 21:52:43 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2010-11-21 21:52:43 +0100 |
commit | 3ce504b62ea5a08d2d499bfd4f0c061ca7af7636 (patch) | |
tree | ba27d093c8c2c6538f5865c68c507a9085df0c0f | |
parent | 5538597e20a2f4f34743fc4f88cb3f7e12ec8457 (diff) | |
download | i3-AnyEvent-0.07.tar.gz i3-AnyEvent-0.07.zip |
introduce get_tree request (tree branch only)AnyEvent-0.07
-rw-r--r-- | lib/AnyEvent/I3.pm | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/AnyEvent/I3.pm b/lib/AnyEvent/I3.pm index 61486488..d191241c 100644 --- a/lib/AnyEvent/I3.pm +++ b/lib/AnyEvent/I3.pm @@ -15,11 +15,11 @@ AnyEvent::I3 - communicate with the i3 window manager =cut -our $VERSION = '0.06'; +our $VERSION = '0.07'; =head1 VERSION -Version 0.06 +Version 0.07 =head1 SYNOPSIS @@ -64,9 +64,10 @@ use constant TYPE_COMMAND => 0; use constant TYPE_GET_WORKSPACES => 1; use constant TYPE_SUBSCRIBE => 2; use constant TYPE_GET_OUTPUTS => 3; +use constant TYPE_GET_TREE => 4; our %EXPORT_TAGS = ( 'all' => [ - qw(i3 TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS) + qw(i3 TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS TYPE_GET_TREE) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{all} } ); @@ -322,6 +323,23 @@ sub get_outputs { $self->message(TYPE_GET_OUTPUTS) } +=head2 get_tree + +Gets the layout tree from i3 (tree branch only). + + my $tree = i3->get_tree->recv; + say Dumper($tree); + +=cut +sub get_tree { + my ($self) = @_; + + $self->_ensure_connection; + + $self->message(TYPE_GET_TREE) +} + + =head2 command($content) Makes i3 execute the given command |