1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 04:39:03 -08:00

automatically source compatible scripts in bash

This commit is contained in:
Connor Olding 2021-07-29 07:26:45 -07:00
parent 04e890db1b
commit 1c562ad0f9
3 changed files with 20 additions and 16 deletions

View file

@ -4,11 +4,11 @@
# {{{1 utilities
#SOURCING=$((SOURCING+1))
#. ~/sh/ify
#. ~/sh/has
#. ~/sh/maybesudo
#SOURCING=$((SOURCING-1))
if [ -z "$ZSH_VERSION" ]; then
has() { # hardcode this function from ~/sh/has for convenience
which "$1" >/dev/null 2>&1 && which "$1"
}
fi
# not available in busybox:
#exports() {

View file

@ -38,25 +38,28 @@ ret_fail="$_title${Cfail}$_line1\n${Cfail}$_line2"
PROMPT_COMMAND='[ $? = 0 ] && PS1=${ret_succ} || PS1=${ret_fail}'
SOURCING=$((SOURCING+1))
. ~/sh/echo2
. ~/sh/note
. ~/sh/stfu
. ~/sh/has
SOURCING=$((SOURCING-1))
echo START.-shrc
. ~/.-shrc
echo FINISH.-shrc
SOURCING=$((SOURCING+1))
. ~/sh/arrays
. ~/sh/streamcrap
SOURCING=$((SOURCING-1))
alias pl="printf '%s\n'"
# this doesn't work for all scripts at the moment, but
ADDPATH "$HOME/sh"
echo START.MERGING
(
cd ~/sh \
&& printf "%s\n" '#!/usr/bin/env false' '[ "${SOURCING:-0}" -gt 0 ] || exit 1' '' \
| cat - $(grep -lF 'YES_BASH' $(find ~/sh -maxdepth 1 -type f)) \
> ~/.sh-bash
)
echo FINISH.MERGING
SOURCING=$((SOURCING+1))
. ~/.sh-bash
SOURCING=$((SOURCING-1))
# TODO: respect initctl like in .zshrc.
alias reload='cd; exec bash'
echo FINISH.bashrc

View file

@ -1,6 +1,7 @@
#!/usr/bin/env false
# awful things
# YES_ZSH
# YES_BASH
MPV_STREAM_FLAGS="--quiet --autofit=1280x720 --loop-playlist=no --no-resume-playback --no-sub \
--no-initial-audio-sync --mc=0.02 --autosync=30"