tests: add test for dock client + restart
This commit is contained in:
@ -11,7 +11,7 @@ use List::Util qw(first);
|
||||
use v5.10;
|
||||
|
||||
use Exporter ();
|
||||
our @EXPORT = qw(get_workspace_names get_unused_workspace get_ws_content get_ws get_focused open_empty_con open_standard_window cmd does_i3_live);
|
||||
our @EXPORT = qw(get_workspace_names get_unused_workspace get_ws_content get_ws get_focused open_empty_con open_standard_window get_dock_clients cmd does_i3_live);
|
||||
|
||||
my $tester = Test::Builder->new();
|
||||
|
||||
@ -129,6 +129,19 @@ sub get_focused {
|
||||
return $lf;
|
||||
}
|
||||
|
||||
sub get_dock_clients {
|
||||
my $tree = i3("/tmp/nestedcons")->get_tree->recv;
|
||||
my @outputs = @{$tree->{nodes}};
|
||||
# Children of all dockareas
|
||||
my @docked;
|
||||
for my $output (@outputs) {
|
||||
@docked = (@docked, map { @{$_->{nodes}} }
|
||||
grep { $_->{type} == 5 }
|
||||
@{$output->{nodes}});
|
||||
}
|
||||
return @docked;
|
||||
}
|
||||
|
||||
sub cmd {
|
||||
i3("/tmp/nestedcons")->command(@_)->recv
|
||||
}
|
||||
|
Reference in New Issue
Block a user