2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-11-17 21:26:22 +00:00
NanoDroid/Full/system/etc/bashrc
Christopher Roy Bratusek 358ba0c6f9 fixup
2019-05-05 21:20:28 +02:00

47 lines
910 B
Bash

# /system/etc/bashrc
export SHELL=${BASH}
# select storage path
if [ -n ${EXTERNAL_STORAGE} ]; then
export HOME="${EXTERNAL_STORAGE}"
else
if [ -w /sdcard ]; then
export HOME="/sdcard"
elif [ -w /storage/self/primary ]; then
export HOME="/storage/self/primary"
elif [ -w /data/media/0 ]; then
export HOME="/data/media/0"
fi
fi
export TMPDIR=${HOME}/.bash_tmp
export HISTFILE=${HOME}/.bash_history
mkdir -p ${TMPDIR}
export TERM=xterm
export PAGER=less.bin
[[ $- != *i* ]] && return
shopt -s checkwinsize
shopt -s histappend
alias su="su --shell ${SHELL}"
alias ls="ls --color=auto"
alias grep="grep --color=auto"
red="\[\033[01;38;5;1m\]"
gre="\[\033[01;38;5;2m\]"
blu="\[\033[01;38;5;4m\]"
whi="\[\033[01;38;5;7m\]"
export HOSTNAME=$(getprop ro.product.device)
export PS1="${whi}[ ${blu}\$(whoami) ${whi}@ ${red}${HOSTNAME} ${whi}: ${gre}\w ${whi}] "
resize >/dev/null
clear
cd ${HOME}