dotfiles

personal dotfiles
git clone anongit@rnpnr.xyz:dotfiles.git
Log | Files | Refs | Feed | Submodules

sfeed_dmenu (538B)


      1 #!/bin/sh
      2 
      3 # presents a list of unread feed entries using dmenu
      4 # prints selected entry to stdout and marks it as read
      5 
      6 configdir=~/.config/sfeed
      7 
      8 usage()
      9 {
     10 	echo "usage: $(basename $0) feedname [...]"
     11 	exit 1
     12 }
     13 
     14 [ ${#} -lt 1 ] && usage
     15 
     16 unread()
     17 {
     18 	sfeed_unread "$SFEED_URL_FILE" $@
     19 }
     20 
     21 for arg; do
     22 	. $configdir/${arg}.sh
     23 	[ -d "$sfeedpath" ] || continue
     24 	list=$(printf "%s\n" "$(unread "$sfeedpath/*")" "$list")
     25 done
     26 
     27 url=$(echo "$list" | dmenu -i -l 15 | cut -f 3)
     28 [ -n "$url" ] || exit 0
     29 echo "$url" | sfeed_markread read
     30 echo "$url"