Skip to content

Instantly share code, notes, and snippets.

@memes
Last active June 16, 2018 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save memes/ebac7e28a7981e67b73b4080e1f45d27 to your computer and use it in GitHub Desktop.
Save memes/ebac7e28a7981e67b73b4080e1f45d27 to your computer and use it in GitHub Desktop.
Termux .profile and .bashrc as used on chromebook, which automatically goes into a chroot to make me feel more at home.
# Configure bash shell for chromebook
HISTCONTROL=ignoreboth
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s checkwinsize
_MEMES_IP=$(ip addr show dev arc0 | gawk '{ if (match($0, /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/, m)) print m[1]}')
PS1='\[\033[01;32m\]\u@${_MEMES_IP}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
[ -f ~/bin/git-prompt.sh ] && . ~/bin/git-prompt.sh
[ -f ~/.bash_memes ] && . ~/.bash_memes
[ -f ~/lib/azure-cli/az.completion ] && . ~/lib/azure-cli/az.completion
# Bash profile for termux on chromebook
if [ "${SHLVL}" == "1" ]; then
termux-chroot
[ -f "${HOME}/.do.not.exit" ] || exit
echo "Remaining in non-chroot shell; remember to remove ${HOME}/.do.not.exit to revert this behaviour"
else
[ -d "${HOME}/bin" ] && export PATH="${HOME}/bin:${PATH}"
[ -f "${HOME}/.profile_memes" ] && . "${HOME}/.profile_memes"
fi
#!/usr/bin/env bash
/home/lib/azure-cli/bin/python -m azure.cli "$@"
_python_argcomplete() {
local IFS=' '
COMPREPLY=( $(IFS="$IFS" COMP_LINE="$COMP_LINE" COMP_POINT="$COMP_POINT" _ARGCOMPLETE_COMP_WORDBREAKS="$COMP_WORDBREAKS" _ARGCOMPLETE=1 "$1" 8>&1 9>&2 1>/dev/null 2>/dev/null) )
if [[ $? != 0 ]]; then
unset COMPREPLY
fi
}
complete -o nospace -F _python_argcomplete "az"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment