]> git.sur5r.net Git - i3/i3/blob - testcases/t/172-start-on-named-ws.t
Merge branch 'fix-take-focus'
[i3/i3] / testcases / t / 172-start-on-named-ws.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # !NO_I3_INSTANCE! will prevent complete-run.pl from starting i3
4 #
5 # checks if i3 starts up on workspace '1' or the first configured named workspace
6 #
7 use X11::XCB qw(:all);
8 use X11::XCB::Connection;
9 use i3test;
10
11 my $x = X11::XCB::Connection->new;
12
13 ##############################################################
14 # 1: i3 should start with workspace '1'
15 ##############################################################
16
17 my $config = <<EOT;
18 # i3 config file (v4)
19 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
20 EOT
21
22 my $pid = launch_with_config($config);
23
24 my @names = @{get_workspace_names()};
25 cmp_deeply(\@names, [ '1' ], 'i3 starts on workspace 1 without any configuration');
26
27 exit_gracefully($pid);
28
29 ##############################################################
30 # 2: with named workspaces, i3 should start on the first named one
31 ##############################################################
32
33 $config = <<EOT;
34 # i3 config file (v4)
35 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
36
37 bindsym Mod1+1 workspace foobar
38 EOT
39
40 $pid = launch_with_config($config);
41
42 my @names = @{get_workspace_names()};
43 cmp_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
44
45 exit_gracefully($pid);
46
47 ##############################################################
48 # 3: the same test as 2, but with a quoted workspace name
49 ##############################################################
50
51 $config = <<EOT;
52 # i3 config file (v4)
53 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
54
55 bindsym Mod1+1 workspace "foobar"
56 EOT
57
58 $pid = launch_with_config($config);
59
60 my @names = @{get_workspace_names()};
61 cmp_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
62
63 exit_gracefully($pid);
64
65 done_testing;