use built-in urxvt::anyevent

master
Michele Guerini Rocco 2021-06-04 11:07:58 +02:00
parent 79d255272d
commit 27516b6209
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450
2 changed files with 6 additions and 8 deletions

View File

@ -7,9 +7,7 @@ stdenv.mkDerivation rec {
src = ./src;
passthru.perlPackages = with perlPackages;
[ AnyEvent LinuxFD SubExporter
DataOptList ParamsUtil SubInstall
];
[ LinuxFD ] ++ LinuxFD.requiredPerlModules;
installPhase = ''
install -D -m644 "$src"/* -t "$out/lib/urxvt/perl"

View File

@ -5,7 +5,7 @@ use strict;
use warnings;
no warnings "experimental";
use AnyEvent;
use urxvt;
use Linux::FD qw(signalfd);
use POSIX;
use File::Basename qw(dirname);
@ -47,9 +47,9 @@ sub build_command {
if (my ($col, $row) = $resources{$_} =~ /(\d+)x(\d+)/) {
$cmd .= "\e[8;${row};${col}t";
}
next RESOURCE;
next;
}
default { next RESOURCE }
default { next }
}
my $val = $resources{$_};
$cmd .= "\e]$key;$val\a";
@ -65,8 +65,8 @@ sub reload_all {
}
}
our $watch = AnyEvent->io (
fh => $sigfd, # which file handle to check
our $watch = urxvt::anyevent->io (
fh => $sigfd, # which file handle to check
poll => "r", # which event to wait for ("r"ead data)
cb => sub { # what callback to execute
sysread $sigfd, my $dummy, 4096;