~umgeher/sfeed-news

aacd4f401bf624dec360d3462727203c494c71c7 — Umgeher Torgersen 2 months ago 56d4cb0 v1.1.0
v1.1.0

+ using $BROWSER env variable
+ news is reading $1 argument as a filter, example: news "r\/openbsd"
2 files changed, 19 insertions(+), 2 deletions(-)

M README.md
M news
M README.md => README.md +11 -0
@@ 13,6 13,17 @@ News is two scripts bundle.

Just copy the files to your local bin directory, chmod +x them and it's done.

## Changelog

### v1.1.0

+ using **$BROWSER** env variable
+ news is reading $1 argument as a filter, example: news "r\/openbsd"

### v1.0.0

+ rise and shine!

## OS tested

+ Artix: Working

M news => news +8 -2
@@ 3,6 3,12 @@
DIR="$HOME/.sfeed"
READ="$DIR/urls"
UNREAD="$DIR/unread"
test $BROWSER || BROWSER="firefox"

url=$(cat $UNREAD | sort | uniq | rofi -dmenu -l 35 | sed -n 's@^.* \([a-zA-Z]*://\)\(.*\)$@\1\2@p')
test -n "$url" && firefox "$url" && echo "$url" >> $READ && grep -Fvf $READ $UNREAD > $DIR/tmp && mv $DIR/tmp $UNREAD
if [[ -n $1 ]]; then
    url=$(cat $UNREAD | egrep $1 | sort | uniq | rofi -dmenu -l 35 | sed -n 's@^.* \([a-zA-Z]*://\)\(.*\)$@\1\2@p')
else
    url=$(cat $UNREAD | sort | uniq | rofi -dmenu -l 35 | sed -n 's@^.* \([a-zA-Z]*://\)\(.*\)$@\1\2@p')
fi

test -n "$url" && $BROWSER "$url" && echo "$url" >> $READ && grep -Fvf $READ $UNREAD > $DIR/tmp && mv $DIR/tmp $UNREAD