AnyEvent-I3
view release on metacpan or search on metacpan
* Implement GET_TREE request
0.06 2010-06-16
* Add check to Makefile to abort in a Windows environment (neither i3 nor
unix sockets available)
0.05 2010-06-09
* use getpwuid() to resolve ~ in socket paths instead of glob()
0.04 2010-03-27
* use new default ipc-socket path, glob() path, bump version
0.03 2010-03-26
* fix MANIFEST
0.02 2010-03-23
lib/AnyEvent/I3.pm view on Meta::CPAN
my ($class, $path) = @_;
$path = _call_i3('--get-socketpath') unless $path;
# This is the old default path (v3.*). This fallback line can be removed in
# a year from now. -- Michael, 2012-07-09
$path ||= '~/.i3/ipc.sock';
# Check if we need to resolve ~
if ($path =~ /~/) {
# We use getpwuid() instead of $ENV{HOME} because the latter is tainted
# and thus produces warnings when running tests with perl -T
my $home = (getpwuid($<))[7];
confess "Could not get home directory" unless $home and -d $home;
$path =~ s/~/$home/g;
}
bless { path => $path } => $class;
}
=head2 $i3->connect
Establishes the connection to i3. Returns an C<AnyEvent::CondVar> which will
( run in 0.307 second using v1.01-cache-2.11-cpan-8d75d55dd25 )