summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/nb1
-rwxr-xr-x.local/bin/ref-newsboat24
2 files changed, 13 insertions, 12 deletions
diff --git a/.local/bin/nb b/.local/bin/nb
index 117840d..3b36835 100755
--- a/.local/bin/nb
+++ b/.local/bin/nb
@@ -1,5 +1,6 @@
#!/bin/sh
+[ $(hostname -s) = "po-rbo" ] && exec newsboat
[ -f /tmp/cache.db ] && exec newsboat -c /tmp/cache.db -u /tmp/urls
cache_file="$XDG_DATA_HOME/newsboat/cache.db.gpg"
urls_file="$XDG_CONFIG_HOME/newsboat/urls.gpg"
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'
+ ' <b>' . $stdout . '</b> new articles'
);
}
- exit 0;
+ return;
}
main();