Add TYPE_GET_MARKS and accompanying sugar method

This commit is contained in:
Michael Stapelberg 2011-10-12 23:26:04 +01:00
parent d7bd645863
commit 7a934b94dd
1 changed files with 19 additions and 1 deletions

View File

@ -66,9 +66,11 @@ use constant TYPE_SUBSCRIBE => 2;
use constant TYPE_GET_OUTPUTS => 3; use constant TYPE_GET_OUTPUTS => 3;
use constant TYPE_GET_TREE => 4; use constant TYPE_GET_TREE => 4;
use constant TYPE_GET_MARKS => 5; use constant TYPE_GET_MARKS => 5;
use constant TYPE_GET_BAR_CONFIG => 6;
our %EXPORT_TAGS = ( 'all' => [ 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} } ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{all} } );
@ -356,6 +358,22 @@ sub get_marks {
$self->message(TYPE_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) =head2 command($content)
Makes i3 execute the given command Makes i3 execute the given command