]> gitweb.fluxo.info Git - wrappers.git/commitdiff
Feat: news: cmpile a list of OPMLs from the feeds repository, if available
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 30 Dec 2025 23:31:38 +0000 (20:31 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 30 Dec 2025 23:31:38 +0000 (20:31 -0300)
news

diff --git a/news b/news
index a4c3ff4f0b6c804cc5b9bcc885509fa769ad2328..28367e6420f6e97cd111ac86e5d3f4e5b8198e22 100755 (executable)
--- a/news
+++ b/news
@@ -7,11 +7,11 @@
 BASENAME="`basename $0`"
 #APP="newsbeuter"
 APP="newsboat"
+OPML="$HOME/.custom/newsboat/opml.conf"
 
-# Check configuration
-if [ ! -e "$HOME/.custom/$APP/config" ]; then
+# Check config folder
+if [ ! -e "$HOME/.custom/$APP" ]; then
   mkdir -p $HOME/.custom/$APP
-  touch    $HOME/.custom/$APP/config
 fi
 
 # Check data folder
@@ -19,6 +19,27 @@ 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
+    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