Move get_output_for_workspace() to i3test

This commit is contained in:
Orestis Floros
2018-03-28 01:57:54 +03:00
parent bc439de755
commit 1d5b43c18f
3 changed files with 24 additions and 30 deletions

View File

@ -30,21 +30,6 @@ workspace 2:override output fake-1
fake-outputs 1024x768+0+0,1024x768+1024+0
EOT
my $i3 = i3(get_socket_path());
$i3->connect->recv;
# Returns the name of the output on which this workspace resides
sub get_output_for_workspace {
my $ws_name = shift @_;
foreach (grep { not $_->{name} =~ /^__/ } @{$i3->get_tree->recv->{nodes}}) {
my $output = $_->{name};
foreach (grep { $_->{name} =~ "content" } @{$_->{nodes}}) {
return $output if $_->{nodes}[0]->{name} =~ $ws_name;
}
}
}
################################################################################
# Workspace assignments with bare numbers should be interpreted as `workspace
# number` config directives. Any workspace beginning with that number should be

View File

@ -31,21 +31,6 @@ workspace baz output fake-1
workspace 5 output left
EOT
my $i3 = i3(get_socket_path());
$i3->connect->recv;
# Returns the name of the output on which this workspace resides
sub get_output_for_workspace {
my $ws_name = shift @_;
foreach (grep { not $_->{name} =~ /^__/ } @{$i3->get_tree->recv->{nodes}}) {
my $output = $_->{name};
foreach (grep { $_->{name} =~ "content" } @{$_->{nodes}}) {
return $output if $_->{nodes}[0]->{name} =~ $ws_name;
}
}
}
##########################################################################
# Renaming the workspace to an unassigned name does not move the workspace
# (regression test)