2 # vim:ts=4:sw=4:expandtab
3 # Beware that this test uses workspace 9 to perform some tests (it expects
4 # the workspace to be empty).
5 # TODO: skip it by default?
7 use Test::More tests => 9;
11 use Time::HiRes qw(sleep);
13 use Digest::SHA1 qw(sha1_base64);
14 use lib "$FindBin::Bin/lib";
18 use_ok('IO::Socket::UNIX') or BAIL_OUT('Cannot load IO::Socket::UNIX');
19 use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
22 my $x = X11::XCB::Connection->new;
24 my $sock = IO::Socket::UNIX->new(Peer => '/tmp/i3-ipc.sock');
25 isa_ok($sock, 'IO::Socket::UNIX');
27 # Switch to the nineth workspace
28 $sock->write(i3test::format_ipc_command("9"));
32 #####################################################################
33 # Create two windows and put them in stacking mode
34 #####################################################################
36 my $top = i3test::open_standard_window($x);
38 my $bottom = i3test::open_standard_window($x);
41 $sock->write(i3test::format_ipc_command("s"));
44 #####################################################################
45 # Add the urgency hint, switch to a different workspace and back again
46 #####################################################################
47 $top->add_hint('urgency');
50 $sock->write(i3test::format_ipc_command("1"));
52 $sock->write(i3test::format_ipc_command("9"));
54 $sock->write(i3test::format_ipc_command("1"));
57 my $std = i3test::open_standard_window($x);
59 $std->add_hint('urgency');