diff options
author | joe <rbo@gmx.us> | 2025-10-05 16:31:12 +0200 |
---|---|---|
committer | joe <rbo@gmx.us> | 2025-10-05 16:31:12 +0200 |
commit | 197e9691db69bce004125d1bf4e70b18bb6a5788 (patch) | |
tree | e17ad5d0d53fd14bb25277b9c5db9ff688c596b9 /.local/bin/ref-newsboat | |
parent | up (diff) | |
download | dotfiles-bsd-197e9691db69bce004125d1bf4e70b18bb6a5788.tar.gz dotfiles-bsd-197e9691db69bce004125d1bf4e70b18bb6a5788.tar.bz2 dotfiles-bsd-197e9691db69bce004125d1bf4e70b18bb6a5788.tar.xz dotfiles-bsd-197e9691db69bce004125d1bf4e70b18bb6a5788.tar.zst dotfiles-bsd-197e9691db69bce004125d1bf4e70b18bb6a5788.zip |
up
Diffstat (limited to '.local/bin/ref-newsboat')
-rwxr-xr-x | .local/bin/ref-newsboat | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/.local/bin/ref-newsboat b/.local/bin/ref-newsboat deleted file mode 100755 index e5d9848..0000000 --- a/.local/bin/ref-newsboat +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Capture::Tiny qw(capture); - -use constant { - NEWSBOAT_PATH => 'newsboat', - NOTIFYSEND_PATH => 'herbe' -}; - -sub notify -{ - my ($str) = @_; - - my $pid = fork(); - if (not $pid) { - exec(NOTIFYSEND_PATH, $str); - } - return; -}; - -sub main -{ - my $stdout; - my $nb; - - $nb = NEWSBOAT_PATH; - if (system( - $nb, - '-x', - 'reload' - ) != 0) { - exit 1; - } - - $stdout = qx($nb -x print-unread); - $stdout =~ s/\s.+//; - chomp $stdout; - if ($stdout != 0) { - notify(' ' . $stdout . ' new articles'); - } - return; -} - -main(); - -__END__ |