config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

sfeed_curses (553B)


      1 #!/bin/sh
      2 # Copyright 2022 Jacob R. Edwards
      3 # Allow configuration file for sfeed_curses
      4 
      5 getargs() {
      6 	nocomment "$@" | awk '! /=/ {
      7 		print "Invalid sfeed_curses config (not an assignment)" > "/dev/stderr"
      8 		exit 1
      9 	}
     10 	1 {
     11 		gsub("\\$HOME", ENVIRON["HOME"], $0);
     12 		print
     13 	}'
     14 }
     15 
     16 
     17 IFS='
     18 '
     19 rc="$HOME"/.sfeed/sfeed_cursesrc
     20 s="$(whereis sfeed_curses)"
     21 
     22 set -e
     23 
     24 # Allow sfeedpath to be set from sfeedrc
     25 . "$HOME"/.sfeed/sfeedrc
     26 
     27 test $# -eq 0 &&
     28 	set -- ${sfeedpath:-"$HOME"/.sfeed/feeds}/*
     29 test -f "$rc" &&
     30 	args="$(getargs "$rc")"
     31 exec env $args "$s" "$@"