0

use AnyEvent::Timer::Cron only if cron enabled in config

This commit is contained in:
Sergei Fedosov
2021-07-19 17:01:26 +03:00
parent ab68a26e84
commit f63dba554c

View File

@@ -19,7 +19,6 @@ use utf8;
use open qw (:std :utf8); use open qw (:std :utf8);
use Fcntl qw (:seek); use Fcntl qw (:seek);
use AnyEvent; use AnyEvent;
use AnyEvent::Timer::Cron;
use AnyEvent::I3; use AnyEvent::I3;
use JSON::XS; use JSON::XS;
use Encode; use Encode;
@@ -36,6 +35,12 @@ sub readconf ();
sub active_win_borders (); sub active_win_borders ();
my $CONF = readconf (); my $CONF = readconf ();
# load AnyEvent::Timer::Cron only if cron enabled in config
if ($CONF->{'cron'}->{enabled}) {
require AnyEvent::Timer::Cron;
}
my $i3 = i3 (); my $i3 = i3 ();
my $done = AnyEvent->condvar; my $done = AnyEvent->condvar;
$i3->connect->recv or die 'Unable to connect to i3'; $i3->connect->recv or die 'Unable to connect to i3';