config

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

commit faf7f07fdaa0b76f60ca4ae70f9bbaabe65545ec
parent 7d17a891a4ea3961cb4903fd0f1739de6345bcd5
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Tue,  2 Mar 2021 14:07:50 -0800

Remove FEED_DIR environ(1) variable

Now rss feeds are stored in `$XDG_DATA_HOME/feed' rather than
FEED_DIR and a dalias entry pointing to this location was added
allowing pleasent usage with ksh(1) directory aliases.  The fed
shell function now makes use of the previously mentioned dalias
entry, it was not removed because doing so would make it difficult
to use on shells without directory aliases.

Diffstat:
Mlocal/bin/.local/bin/upfeed | 3++-
Mlocal/dalias/.config/dalias | 1+
Mlocal/profile/.profile | 1-
Mlocal/shell/.config/shell/etc | 2+-
4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/local/bin/.local/bin/upfeed b/local/bin/.local/bin/upfeed @@ -10,6 +10,7 @@ # `$XDG_CONFIG_HOME/upfeedrc'. Configuration files may contain blank # lines or comments (`#') and are of the format `<name>[ \t]+<url>'. +prefix="${XDG_DATA_DIR:-$HOME/.local/share}/feed" rc="${XDG_CONFIG_HOME:-$HOME/.config}/upfeedrc" update() { @@ -17,7 +18,7 @@ update() { echo 'upfeed: update: Invalid number of arguments.' 1>&2 exit 1 } - curl -Ss "$2" | sfeed >"${FEED_DIR:-.}/$1" + curl -Ss "$2" | sfeed >"$prefix/$1" echo "$1" } diff --git a/local/dalias/.config/dalias b/local/dalias/.config/dalias @@ -7,3 +7,4 @@ note random notes ~/own/text/note src programming projects ~/own/src kjv awk bible processor ~/own/src/awk/kjv2 fork software forks ~/own/src/fork +feed rss feeds ${XDG_DATA_DIR:-$HOME/.local/share}/feed diff --git a/local/profile/.profile b/local/profile/.profile @@ -23,7 +23,6 @@ export XDG_DATA_HOME="$HOME/.local/share" export CDPATH=".:$HOME/own:$HOME/.local" export DICT_DIR="$HOME/.local/share/wdef/" export ENV="$XDG_CONFIG_HOME/ksh.kshrc" -export FEED_DIR="$HOME/.local/var/rss/" export HISTBASE="$HOME/.local/var" export INPUTRC="$XDG_CONFIG_HOME/readline" export LESS="X F M r S W x2 ~ q i b80 h15 z23 j5 x8" diff --git a/local/shell/.config/shell/etc b/local/shell/.config/shell/etc @@ -1,6 +1,6 @@ # shell functions -fed() (cd ${FEED_DIR:?unset} && feed "$@") +fed() (cd "$(dalias feed)" && feed "$@") hfmt() lynx -dump "${@:--stdin}" loop() while eval "$@"; do done wloop() while { read && eval "$@" ;}; do done