From: Michael Stapelberg Date: Wed, 12 Oct 2011 22:26:04 +0000 (+0100) Subject: Add TYPE_GET_MARKS and accompanying sugar method X-Git-Tag: 4.14~14^2~24 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7a934b94dd62bd05d2df59518d66410ccbac1492;p=i3%2Fi3 Add TYPE_GET_MARKS and accompanying sugar method --- diff --git a/lib/AnyEvent/I3.pm b/lib/AnyEvent/I3.pm index 3977e652..4a5e8c24 100644 --- a/lib/AnyEvent/I3.pm +++ b/lib/AnyEvent/I3.pm @@ -66,9 +66,11 @@ use constant TYPE_SUBSCRIBE => 2; use constant TYPE_GET_OUTPUTS => 3; use constant TYPE_GET_TREE => 4; use constant TYPE_GET_MARKS => 5; +use constant TYPE_GET_BAR_CONFIG => 6; our %EXPORT_TAGS = ( 'all' => [ - qw(i3 TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS TYPE_GET_TREE TYPE_GET_MARKS) + qw(i3 TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS + TYPE_GET_TREE TYPE_GET_MARKS TYPE_GET_BAR_CONFIG) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{all} } ); @@ -356,6 +358,22 @@ sub get_marks { $self->message(TYPE_GET_MARKS) } +=head2 get_bar_config + +Gets the bar configuration for the specific bar id from i3 (>= v4.1). + + my $config = i3->get_bar_config($id)->recv; + say Dumper($config); + +=cut +sub get_bar_config { + my ($self, $id) = @_; + + $self->_ensure_connection; + + $self->message(TYPE_GET_BAR_CONFIG, $id) +} + =head2 command($content) Makes i3 execute the given command