add simple web function

This commit is contained in:
Daylin Morgan 2023-02-06 11:17:51 -06:00
parent ea1ef0fe42
commit 354a5fc535

View file

@ -110,3 +110,20 @@ print-paths() {
ta () { ta () {
tmux attach -t "$@" || tmux new-session -s "$@" tmux attach -t "$@" || tmux new-session -s "$@"
} }
web () {
if [[ -z "$BROWSER" ]]; then
echo 'set $BROWSER'
return
fi
for i
do
if [[ ! -r $i ]]
then
echo "$0: file doesn't exist: \`$i'" >&2
continue
fi
$BROWSER "$i" > /dev/null 2>&1 &
disown
done
}