if [ "$action" = "view" ]; then
echo "${url_array[$article]}"
elif [ "$action" = "read" ]; then
if [ -n "$BROWSER" ]; then
"$BROWSER" "${url_array[$article]}"
elif type -P 'xdg-open'; then
xdg-open "${url_array[$article]}"
else
read -p "Please enter your browser's binary (e.g. firefox -- if it's in your \$PATH), or the full location of the binary (e.g. /opt/firefox/firefox): " browser
if [[ "$browser" == *"firefox"* ]] || [[ "$browser" == *"palemoon"* ]]; then
eval "$browser --new-tab ${url_array[$article]}"
else
eval "$browser ${url_array[$article]}"
fi
fi
fi
And/or the $BROWSER environment variable. Basically something like this:
elif [ "$action" = "read" ]; then
if [ -n "$BROWSER" ]; then
$BROWSER "$url"
elif type -P 'xdg-open'; then
xdg-open "$url"
else
read -p "Please enter your browser's binary " browser
[.. trim ..]
fi
fi
I wonder if there’s a standard way to specify the opener binary; something like, export OPEN="$(which xdg-open)" (since not all platforms use xdg-open).
Neat!
Looking at the way browsers are handled, would you consider using
xdg-open
instead?Done:
And/or the
$BROWSER
environment variable. Basically something like this:I wonder if there’s a standard way to specify the opener binary; something like,
export OPEN="$(which xdg-open)"
(since not all platforms usexdg-open
).Not as far as I know; if you use an
xdg-open
alternative then having some sort of wrapper is probably the best solution.Sorry for the late reply, I didn’t notice the time when I posted this and had to do go to sleep pretty much directly after posting.
I can, I just haven’t yet because I don’t use any XDG stuff. (I’m on Gentoo and don’t want to installs all the deps for it.)
Nice! FYI, bash also seems to be an unmentioned dependency, but I understand if you like its conveniences!
Good point, I’ll list bash as well.
Simple version using the under appreciated http://xmlstar.sourceforge.net/ parsing the rss feed:
My terminal allows me to click links, so I don’t need the number system
I made an improvement!
Edit: and made it a script in my dotfiles.
ah, very nice! great idea with the use of
column
[Comment removed by author]