Skip to content

Instantly share code, notes, and snippets.

@leedo
Created January 31, 2015 21:54
Show Gist options
  • Save leedo/63baab84051a8dfd564f to your computer and use it in GitHub Desktop.
Save leedo/63baab84051a8dfd564f to your computer and use it in GitHub Desktop.
bindsym $mod+j exec i3-window-warp focus left
#!/usr/bin/env perl
use AnyEvent;
use AnyEvent::I3 ":all";
my $i3 = i3();
$i3->connect->recv or die "Error connecting";
my $command = join(" ", @ARGV) or die "need command";
my $cv = AE::cv;
$i3->subscribe({
window => sub {
if ($_[0]->{change} =~ /^(focus|new)$/) {
my ($x, $y) = @{$_[0]->{container}{rect}}{qw{x y}};
system(qw{xdotool mousemove}, $x + 10, $y - 10);
}
$cv->send;
},
});
$i3->command($command);
$cv->recv;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment