Skip to content

Instantly share code, notes, and snippets.

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