diff options
author | joe <rbo@gmx.us> | 2025-10-01 22:33:48 +0200 |
---|---|---|
committer | joe <rbo@gmx.us> | 2025-10-01 22:33:48 +0200 |
commit | 8854fa0f8a831264ed815b3615038dec89c6f632 (patch) | |
tree | cb0eda5ade37b16adb72ee084e20fe284b2c90a1 /.local/bin/ref-newsboat | |
parent | up (diff) | |
download | dotfiles-bsd-8854fa0f8a831264ed815b3615038dec89c6f632.tar.gz dotfiles-bsd-8854fa0f8a831264ed815b3615038dec89c6f632.tar.bz2 dotfiles-bsd-8854fa0f8a831264ed815b3615038dec89c6f632.tar.xz dotfiles-bsd-8854fa0f8a831264ed815b3615038dec89c6f632.tar.zst dotfiles-bsd-8854fa0f8a831264ed815b3615038dec89c6f632.zip |
up
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; } |