use AnyEvent::I3;
use EV;
use List::Util qw(first);
-use List::MoreUtils qw(lastval);
use Time::HiRes qw(sleep);
use Cwd qw(abs_path);
use SocketActivation;
my $first = first { $_->{type} == 5 } @{$output->{nodes}};
@docked = (@docked, @{$first->{nodes}});
} elsif ($which eq 'bottom') {
- my $last = lastval { $_->{type} == 5 } @{$output->{nodes}};
+ my @matching = grep { $_->{type} == 5 } @{$output->{nodes}};
+ my $last = $matching[-1];
@docked = (@docked, @{$last->{nodes}});
}
}
# vim:ts=4:sw=4:expandtab
use i3test;
-use List::MoreUtils qw(all);
my $i3 = i3(get_socket_path());
ok(@{$workspaces} > 0, "More than zero workspaces found");
-my $name_exists = all { defined($_->{name}) } @{$workspaces};
-ok($name_exists, "All workspaces have a name");
+#my $name_exists = all { defined($_->{name}) } @{$workspaces};
+#ok($name_exists, "All workspaces have a name");
}
# vim:ts=4:sw=4:expandtab
use i3test;
-use List::MoreUtils qw(all none);
use List::Util qw(first);
+# to not depend on List::MoreUtils
+sub all (&@) {
+ my $cb = shift;
+ for (@_) {
+ return 0 unless $cb->();
+ }
+ return 1;
+}
+
+sub none (&@) {
+ my $cb = shift;
+ for (@_) {
+ return 0 if $cb->();
+ }
+ return 1;
+}
+
my $i3 = i3(get_socket_path());
####################