use strict;
use AnyEvent;
use AnyEvent::I3;
my $i3 = i3();
$i3->connect->recv or die "Error connecting to i3";
$i3->command("workspace 1")->recv;
####
use strict;
use AnyEvent;
use AnyEvent::I3;
my $i3 = i3();
$i3->connect->recv or die "Error connecting to i3";
$i3->subscribe({
workspace => \&handle
})->recv->{success} or die "Error subscribing to events";
AE::cv->recv;
sub handle {
my($data)=@_;
if($data->{change} eq "empty") {
print "empty workspace!!\n";
}
}
##
##
use strict;
use AnyEvent;
use AnyEvent::I3;
my $i3 = i3();
$i3->connect->recv or die "Error connecting to i3";
$i3->subscribe({
workspace => \&handle
})->recv->{success} or die "Error subscribing to events";
AE::cv->recv;
sub handle {
my($data)=@_;
if($data->{change} eq "empty") {
print "empty workspace!!\n";
$i3->command("workspace 1")->recv;
}
}
##
##
EV: error in callback (ignoring): AnyEvent::CondVar: recursive blocking wait attempted