From 48cdd374b0dc9586b805c4f81579f161c601b9d9 Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 20 Aug 2025 11:36:23 +0200 Subject: up --- .local/bin/ref-newsboat | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to '.local/bin/ref-newsboat') diff --git a/.local/bin/ref-newsboat b/.local/bin/ref-newsboat index 090ca63..ca1aee1 100755 --- a/.local/bin/ref-newsboat +++ b/.local/bin/ref-newsboat @@ -5,27 +5,25 @@ use warnings; use Capture::Tiny qw(capture); use constant { - NEWSBOAT_PATH => '/usr/local/bin/newsboat', - NOTIFY_SEND_PATH => '/usr/local/bin/notify-send' + NEWSBOAT_PATH => 'newsboat', + NOTIFY_SEND_PATH => 'notify-send' }; sub main { my $stdout; + my $nb; + + $nb = NEWSBOAT_PATH; if (system( - NEWSBOAT_PATH, + $nb, '-x', 'reload' ) != 0) { exit 1; } - ($stdout, undef, undef) = capture { - system( - NEWSBOAT_PATH, - '-x', - 'print-unread' - ); - }; + + $stdout = qx($nb -x print-unread); $stdout =~ s/\s.+//; chomp $stdout; if ($stdout != 0) { @@ -33,11 +31,13 @@ sub main NOTIFY_SEND_PATH, '-u', 'low', + '-t', + '4000', 'newsboat', - ' ' . $stdout . ' new articles' + ' ' . $stdout . ' new articles' ); } - exit 0; + return; } main(); -- cgit v1.2.3