diff options
Diffstat (limited to '')
-rwxr-xr-x | .local/bin/linkview | 19 | ||||
-rwxr-xr-x | .local/bin/nb | 1 | ||||
-rwxr-xr-x | .local/bin/newsboat-notif | 3 | ||||
-rwxr-xr-x | .local/bin/ref-newsboat | 24 |
4 files changed, 28 insertions, 19 deletions
diff --git a/.local/bin/linkview b/.local/bin/linkview index bc53897..349d5c8 100755 --- a/.local/bin/linkview +++ b/.local/bin/linkview @@ -35,7 +35,7 @@ use constant PROG_LIST => "" . "play" . "\n" . "img" . "\n" . "dl" . "\n" . -"pod" . "\n" . +"audio" . "\n" . "pdf" . "\n" . "w3m" . "\n" . "browser" . "\n" . @@ -94,9 +94,6 @@ sub open_link } return; } - elsif ($a eq "mpv-term") { - exec(TERMINAL_PATH, '-e', MPV_PATH, '--audio-channels=stereo', $url); - } elsif ($a eq "dl") { if (is_yt($url) != 0) { $list = QUAL_LIST; @@ -266,7 +263,7 @@ sub open_link } return; } - elsif ($a eq "pod") { + elsif ($a eq "audio") { $pid = fork(); if (not $pid) { setsid(); @@ -278,7 +275,15 @@ sub open_link 'playing media', ' playing <b>' . $article_name . '</b>' ); - if (system(TERMINAL_PATH, "-e", MPV_PATH, $url) != 0) { + if (system( + TERMINAL_PATH, + "-e", + MPV_PATH, + "--vo=null", + "--video=no", + "--no-video", + $url + ) != 0) { exec( NOTIFYSEND_PATH, '-u', 'critical', @@ -460,7 +465,7 @@ sub linkview { my $answer; - if (@ARGV == 0) { + if (@ARGV == 0 || $ARGV[0] eq "") { print STDERR "linkview: no URL\n"; exit 1; } 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/newsboat-notif b/.local/bin/newsboat-notif new file mode 100755 index 0000000..cc2b385 --- /dev/null +++ b/.local/bin/newsboat-notif @@ -0,0 +1,3 @@ +#!/bin/sh + +[ $1 -gt 0 ] && notify-send -u normal -t 6000 newsboat " <b>$@</b> new articles" 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(); |