samedami 9d56d3e272
Add 'shelp' script
Also add simple description comment to all script.
2020-05-15 20:56:33 +02:00

13 lines
392 B
Bash
Executable File

#!/bin/sh
# Add RSS to collection.
! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null &&
notify-send "That doesn't look like a full URL." && exit
RSSFILE="${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls"
if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then
notify-send "You already have this RSS feed."
else
echo "$1" >> "$RSSFILE" && notify-send "RSS feed added."
fi