From 27516b62096a5fc9abe28cd1e27f2dc1fdfca7c1 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Fri, 4 Jun 2021 11:07:58 +0200 Subject: [PATCH] use built-in urxvt::anyevent --- default.nix | 4 +--- src/config-reload | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/default.nix b/default.nix index e0ae2f0..6741175 100644 --- a/default.nix +++ b/default.nix @@ -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" diff --git a/src/config-reload b/src/config-reload index eaad643..9c8aca3 100644 --- a/src/config-reload +++ b/src/config-reload @@ -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;