i3test: add kill_all_windows convenience function

This commit is contained in:
Michael Stapelberg 2017-09-10 11:30:56 +02:00
parent dbd3ca749c
commit 4fd05e4db2
1 changed files with 12 additions and 0 deletions

View File

@ -46,6 +46,7 @@ our @EXPORT = qw(
wait_for_map wait_for_map
wait_for_unmap wait_for_unmap
$x $x
kill_all_windows
); );
=head1 NAME =head1 NAME
@ -900,6 +901,17 @@ sub get_i3_log {
return slurp($logfile); return slurp($logfile);
} }
=head2 kill_all_windows
Kills all windows to clean up between tests.
=cut
sub kill_all_windows {
# Sync in case not all windows are managed by i3 just yet.
sync_with_i3;
cmd '[title=".*"] kill';
}
=head1 AUTHOR =head1 AUTHOR
Michael Stapelberg <michael@i3wm.org> Michael Stapelberg <michael@i3wm.org>