~skuzzymiglet/feef

feef/feef-read -rwxr-xr-x 826 bytes
bd88407askuzzymiglet better readme 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

# RSS reader, using fzf
# dependencies: feef, bash, xargs, xdg-open (or set OPENER), wget (or set DOWNLOADER), fzf

set -euo pipefail

open="${OPENER:-xdg-open}"
download="${DOWNLOADER:-wget}"

time='{{ if .PublishedParsed}}{{.PublishedParsed | datef "02/01" }}{{else}}??/??{{end}}'
fmt="{{truncPad 13 .Feed.Title}} | {{truncPad 75 .Title}} | $time | @ {{.Link}} ~ {{.GUID}} "

openCmd="cut -d@ -f2- <<< {} | xargs $open &"
fzf_binds="enter:execute-silent($openCmd),tab:toggle-sort,ctrl-d:execute-silent(cut -d@ -f2- <<< {} | xargs $download &),ctrl-r:reload(feef -s -f \"$fmt\")"

(
    feef -l error -s -p 10 -f "$fmt" &&
        feef -l fatal -n new -p 1 -r 1m -f "+ $fmt" -c "notify-send \"{{trunc 13 .Feed.Title}}\" \"{{.Title}}\""
    # && feef -n new -r 1m -f "$fmt"
) | fzf --no-mouse --bind "$fzf_binds"