2011-08-02 20:56:24 -04:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
# !NO_I3_INSTANCE! will prevent complete-run.pl from starting i3
|
|
|
|
#
|
|
|
|
# checks if i3 starts up on workspace '1' or the first configured named workspace
|
|
|
|
#
|
|
|
|
use X11::XCB qw(:all);
|
|
|
|
use X11::XCB::Connection;
|
|
|
|
use i3test;
|
|
|
|
|
|
|
|
my $x = X11::XCB::Connection->new;
|
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# 1: i3 should start with workspace '1'
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
my $config = <<EOT;
|
|
|
|
# i3 config file (v4)
|
|
|
|
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
|
|
|
EOT
|
|
|
|
|
2011-10-04 18:34:23 -04:00
|
|
|
my $pid = launch_with_config($config);
|
2011-08-02 20:56:24 -04:00
|
|
|
|
|
|
|
my @names = @{get_workspace_names()};
|
|
|
|
cmp_deeply(\@names, [ '1' ], 'i3 starts on workspace 1 without any configuration');
|
|
|
|
|
2011-10-04 18:34:23 -04:00
|
|
|
exit_gracefully($pid);
|
2011-08-02 20:56:24 -04:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# 2: with named workspaces, i3 should start on the first named one
|
|
|
|
##############################################################
|
|
|
|
|
2011-08-02 21:33:12 -04:00
|
|
|
$config = <<EOT;
|
2011-08-02 20:56:24 -04:00
|
|
|
# i3 config file (v4)
|
|
|
|
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
|
|
|
|
|
|
|
bindsym Mod1+1 workspace foobar
|
|
|
|
EOT
|
|
|
|
|
2011-10-04 18:34:23 -04:00
|
|
|
$pid = launch_with_config($config);
|
2011-08-02 21:33:12 -04:00
|
|
|
|
|
|
|
my @names = @{get_workspace_names()};
|
|
|
|
cmp_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
|
|
|
|
|
2011-10-04 18:34:23 -04:00
|
|
|
exit_gracefully($pid);
|
2011-08-02 21:33:12 -04:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# 3: the same test as 2, but with a quoted workspace name
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
$config = <<EOT;
|
|
|
|
# i3 config file (v4)
|
|
|
|
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
|
|
|
|
|
|
|
bindsym Mod1+1 workspace "foobar"
|
|
|
|
EOT
|
|
|
|
|
2011-10-04 18:34:23 -04:00
|
|
|
$pid = launch_with_config($config);
|
2011-08-02 20:56:24 -04:00
|
|
|
|
|
|
|
my @names = @{get_workspace_names()};
|
|
|
|
cmp_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
|
|
|
|
|
2011-10-04 18:34:23 -04:00
|
|
|
exit_gracefully($pid);
|
2011-08-02 20:56:24 -04:00
|
|
|
|
|
|
|
done_testing;
|