($line =~ /
^\s* # skip leading whitespace
([a-z_]+ \s* = \s*|) # optional identifier
- (.*?) -> \s* # token
+ (.*?) -> \s* # token
(.*) # optional action
/x);
#
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
# (unless you are already familiar with Perl)
-#
+#
#
use i3test;
###############################################################################
# test all window types
-my %window_types = (
+my %window_types = (
'normal' => '_NET_WM_WINDOW_TYPE_NORMAL',
'dialog' => '_NET_WM_WINDOW_TYPE_DIALOG',
'utility' => '_NET_WM_WINDOW_TYPE_UTILITY',
my ($config, $pid, $first, $second, $ws1, $ws2);
sub send_net_active_window {
- my ($id) = @_;
+ my ($id) = @_;
my $msg = pack "CCSLLLLLLL",
X11::XCB::CLIENT_MESSAGE, # response_type
my $_NET_WM_STATE_TOGGLE = 2;
sub set_urgency {
- my ($win, $urgent_flag) = @_;
+ my ($win, $urgent_flag) = @_;
my $msg = pack "CCSLLLLLL",
X11::XCB::CLIENT_MESSAGE, # response_type
32, # format
is($nodes->[1]->{window}, $S->{id}, 'S is right of M');
###############################################################################
-# Given 'S' and 'M' on different workspaces and 'S' is urgent, when 'S' is
+# Given 'S' and 'M' on different workspaces and 'S' is urgent, when 'S' is
# moved to 'M', then the urgency flag is transferred to the target workspace.
###############################################################################
##########################################################################
# Given a floating container and the cursor is in the left upper edge
-# of the output, when moving the container to the mouse, then the
+# of the output, when moving the container to the mouse, then the
# container is moved but adjusted to stay in-bounds.
##########################################################################
##########################################################################
# Given a floating container and the cursor is in the left right lower
-# edge of the output, when moving the container to the mouse, then the
+# edge of the output, when moving the container to the mouse, then the
# container is moved but adjusted to stay in-bounds.
##########################################################################
sub get_wm_state {
sync_with_i3;
- my ($con) = @_;
+ my ($con) = @_;
my $cookie = $x->get_property(
- 0,
+ 0,
$con->{id},
$x->atom(name => '_NET_WM_STATE')->id,
GET_PROPERTY_TYPE_ANY,
- 0,
+ 0,
4096
- );
+ );
my $reply = $x->get_property_reply($cookie->{sequence});
my $len = $reply->{length};
sub get_net_wm_desktop {
sync_with_i3;
- my ($con) = @_;
+ my ($con) = @_;
my $cookie = $x->get_property(
- 0,
+ 0,
$con->{id},
$x->atom(name => '_NET_WM_DESKTOP')->id,
$x->atom(name => 'CARDINAL')->id,
- 0,
+ 0,
1
- );
+ );
my $reply = $x->get_property_reply($cookie->{sequence});
return undef if $reply->{length} != 1;