handle the old bar color config syntax in a backwards-compatible way
This commit is contained in:
@ -208,4 +208,77 @@ is($bar_config->{colors}->{background}, '#000000', 'background color ok');
|
||||
|
||||
exit_gracefully($pid);
|
||||
|
||||
#####################################################################
|
||||
# verify that the old syntax still works
|
||||
#####################################################################
|
||||
|
||||
$config = <<EOT;
|
||||
# i3 config file (v4)
|
||||
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
||||
|
||||
bar {
|
||||
# Start a default instance of i3bar which provides workspace buttons.
|
||||
# Additionally, i3status will provide a statusline.
|
||||
status_command i3status --bar
|
||||
|
||||
output HDMI1
|
||||
output HDMI2
|
||||
|
||||
tray_output LVDS1
|
||||
tray_output HDMI2
|
||||
position top
|
||||
mode dock
|
||||
font Terminus
|
||||
workspace_buttons no
|
||||
verbose yes
|
||||
socket_path /tmp/foobar
|
||||
|
||||
colors {
|
||||
background #ff0000
|
||||
statusline #00ff00
|
||||
|
||||
focused_workspace #ffffff #285577
|
||||
active_workspace #888888 #222222
|
||||
inactive_workspace #888888 #222222
|
||||
urgent_workspace #ffffff #900000
|
||||
}
|
||||
}
|
||||
EOT
|
||||
|
||||
$pid = launch_with_config($config);
|
||||
|
||||
$i3 = i3(get_socket_path(0));
|
||||
$bars = $i3->get_bar_config()->recv;
|
||||
is(@$bars, 1, 'one bar configured');
|
||||
|
||||
$bar_id = shift @$bars;
|
||||
|
||||
cmd 'nop yeah';
|
||||
$bar_config = $i3->get_bar_config($bar_id)->recv;
|
||||
is($bar_config->{status_command}, 'i3status --bar', 'status_command correct');
|
||||
ok($bar_config->{verbose}, 'verbose on');
|
||||
ok(!$bar_config->{workspace_buttons}, 'workspace buttons disabled');
|
||||
is($bar_config->{mode}, 'dock', 'dock mode');
|
||||
is($bar_config->{position}, 'top', 'position top');
|
||||
is_deeply($bar_config->{outputs}, [ 'HDMI1', 'HDMI2' ], 'outputs ok');
|
||||
is($bar_config->{tray_output}, 'HDMI2', 'tray_output ok');
|
||||
is($bar_config->{font}, 'Terminus', 'font ok');
|
||||
is($bar_config->{socket_path}, '/tmp/foobar', 'socket_path ok');
|
||||
is_deeply($bar_config->{colors},
|
||||
{
|
||||
background => '#ff0000',
|
||||
statusline => '#00ff00',
|
||||
focused_workspace_text => '#ffffff',
|
||||
focused_workspace_bg => '#285577',
|
||||
active_workspace_text => '#888888',
|
||||
active_workspace_bg => '#222222',
|
||||
inactive_workspace_text => '#888888',
|
||||
inactive_workspace_bg => '#222222',
|
||||
urgent_workspace_text => '#ffffff',
|
||||
urgent_workspace_bg => '#900000',
|
||||
}, '(old) colors ok');
|
||||
|
||||
exit_gracefully($pid);
|
||||
|
||||
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user