diff options
| author | Silvio Rhatto <rhatto@riseup.net> | 2026-01-27 10:25:51 -0300 |
|---|---|---|
| committer | Silvio Rhatto <rhatto@riseup.net> | 2026-01-27 10:25:51 -0300 |
| commit | 9b6817bf4f4fc8c034f1aed5d65f53b9c73f9d0b (patch) | |
| tree | b9ca8e481dfc1a9653c8bac3beca8fba61ebea40 /newsboater | |
| parent | acafecf2ac6bf9f3a4d19276be7b574404070e63 (diff) | |
| download | wrappers-master.tar.gz wrappers-master.tar.bz2 | |
Diffstat (limited to 'newsboater')
| -rwxr-xr-x | newsboater | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/newsboater b/newsboater new file mode 100755 index 0000000..e0dcd03 --- /dev/null +++ b/newsboater @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# +# Newsboat wrapper. +# + +# Parameters +BASENAME="`basename $0`" +#APP="newsbeuter" +APP="newsboat" +OPML="$HOME/.custom/newsboat/opml.conf" + +# Check config folder +if [ ! -e "$HOME/.custom/$APP" ]; then + mkdir -p $HOME/.custom/$APP +fi + +# Check data folder +if [ ! -e "$HOME/.local/share/$APP" ]; then + mkdir -p $HOME/.local/share/$APP +fi + +# Compile a list of OPMLs from the feeds repository, if available +if [ -d "$HOME/apps/dotfiles/modules/feeds" ]; then + echo -n "opml-url " > $OPML + find $HOME/apps/dotfiles/modules/feeds -name '*.opml' | while read item; do + name="`basename $item .opml`" + base="`dirname $item | sed -e 's/^\.//'`" + + # Skip the sample + if [ "$name" == "sample" ] || [ "$name" == "all" ]; then + continue + fi + + echo -n ' "' >> $OPML + echo -n file://$item >> $OPML + echo -n '"' >> $OPML + done + echo "" >> $OPML +fi + +# Ensure a minimal config +if [ ! -e "$HOME/.custom/$APP/config" ]; then + touch $HOME/.custom/$APP/config + + if [ -e "$OPML" ]; then + echo "# Include some default OPML files" > $HOME/.custom/$APP/config + echo "include \"opml.conf\"" >> $HOME/.custom/$APP/config + fi +fi + +# Dispatch +# Put Tor config directly in $APP configuration +#TORSOCKS_DEBUG=-1 torify $APP +$APP |
