contrib/mrss.sh: added -s flag
This commit is contained in:
parent
72b169826c
commit
66fd0886a7
@ -29,6 +29,8 @@ sub_help() {
|
|||||||
echo " fzf show articles using fzf"
|
echo " fzf show articles using fzf"
|
||||||
echo " use the commands /read (enter), /purge (ctrl-d), /purge-all (ctrl-alt-d),"
|
echo " use the commands /read (enter), /purge (ctrl-d), /purge-all (ctrl-alt-d),"
|
||||||
echo " /watch-later (ctrl-w) and /queue (ctrl-e)"
|
echo " /watch-later (ctrl-w) and /queue (ctrl-e)"
|
||||||
|
echo " you can also run 'fzf feed' for a specific feed."
|
||||||
|
echo " 'fzf -s' shuffles the feed."
|
||||||
echo
|
echo
|
||||||
echo "article commands (pass files as arguments):"
|
echo "article commands (pass files as arguments):"
|
||||||
echo " read opens link from an article file in either a browser or mpv"
|
echo " read opens link from an article file in either a browser or mpv"
|
||||||
@ -234,6 +236,13 @@ sub_select() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub_fzf() {
|
sub_fzf() {
|
||||||
|
while getopts ":s" flag; do
|
||||||
|
case "$flag" in
|
||||||
|
s) MRSS_SHUF="yes";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift `expr $OPTIND - 1`
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
DIR="$MRSS_NEWDIR"
|
DIR="$MRSS_NEWDIR"
|
||||||
else
|
else
|
||||||
@ -243,8 +252,11 @@ sub_fzf() {
|
|||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
NEWARTS="$(find . -type l -or -type f)"
|
NEWARTS="$(find . -type l -or -type f)"
|
||||||
|
if [ -n "$MRSS_SHUF" ]; then
|
||||||
|
NEWARTS=`printf "%s" "$NEWARTS" | shuf`
|
||||||
|
fi
|
||||||
|
|
||||||
OUTPUT="$(printf "%s" "$NEWARTS" |
|
OUTPUT="$(printf "%s" "$NEWARTS" |
|
||||||
export SHELL="/bin/sh"
|
|
||||||
fzf --marker='*' --multi --print-query \
|
fzf --marker='*' --multi --print-query \
|
||||||
--preview "cd $DIR; mrss preview {}" \
|
--preview "cd $DIR; mrss preview {}" \
|
||||||
--bind "ctrl-d:change-query(/purge)+accept" \
|
--bind "ctrl-d:change-query(/purge)+accept" \
|
||||||
|
Loading…
Reference in New Issue
Block a user