diff options
Diffstat (limited to '.local/bin/ref-newsboat')
-rwxr-xr-x | .local/bin/ref-newsboat | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/.local/bin/ref-newsboat b/.local/bin/ref-newsboat index 08ee614..e5d9848 100755 --- a/.local/bin/ref-newsboat +++ b/.local/bin/ref-newsboat @@ -5,8 +5,19 @@ use warnings; use Capture::Tiny qw(capture); use constant { - NEWSBOAT_PATH => 'newsboat', - NOTIFY_SEND_PATH => 'herbe' + NEWSBOAT_PATH => 'newsboat', + NOTIFYSEND_PATH => 'herbe' +}; + +sub notify +{ + my ($str) = @_; + + my $pid = fork(); + if (not $pid) { + exec(NOTIFYSEND_PATH, $str); + } + return; }; sub main @@ -27,10 +38,7 @@ sub main $stdout =~ s/\s.+//; chomp $stdout; if ($stdout != 0) { - system( - NOTIFY_SEND_PATH, - ' ' . $stdout . ' new articles' - ); + notify(' ' . $stdout . ' new articles'); } return; } |