]> git.sur5r.net Git - i3/i3/blobdiff - lib/AnyEvent/I3.pm
Add TYPE_GET_MARKS and accompanying sugar method
[i3/i3] / lib / AnyEvent / I3.pm
index 3977e652adfae74ebb7f203ab7fcb99b07371d71..4a5e8c24fb784e5f005b8ef1ee74f54a5f986cdb 100644 (file)
@@ -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