wip/shell
This commit is contained in:
parent
672b385447
commit
f52abc28b3
50 changed files with 0 additions and 0 deletions
5
shell/bash/completion.sh
Normal file
5
shell/bash/completion.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
file="/usr/share/bash-completion/bash_completion"
|
||||
|
||||
if [ -f "${file}" ]; then
|
||||
. "${file}"
|
||||
fi
|
5
shell/bash/history.sh
Normal file
5
shell/bash/history.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
HISTCONTROL="ignorespace"
|
||||
|
||||
HISTSIZE=-1
|
||||
|
||||
HISTTIMEFORMAT="%Y%m%d %H%M%S "
|
36
shell/bash/prompt.sh
Normal file
36
shell/bash/prompt.sh
Normal file
|
@ -0,0 +1,36 @@
|
|||
ps1() {
|
||||
local date host
|
||||
local code="${1}"
|
||||
date="$(date +%H:%M:%S)"
|
||||
local git
|
||||
host="$(hostname)"
|
||||
local path="${PWD}"
|
||||
local user="${USER}"
|
||||
local view="└ "
|
||||
if [ "${code}" -ne 0 ]; then
|
||||
view="${view}\e[0;31m"
|
||||
else
|
||||
view="${view}\e[0;32m"
|
||||
fi
|
||||
view="${view}${code}\e[0m @ \e[0;33m${date}\e[0m"
|
||||
if [ "$(type -t __git_ps1)" == "function" ]; then
|
||||
git="$(__git_ps1)"
|
||||
if [ -n "${git}" ]; then
|
||||
view="${view} –\e[0;35m${git}\e[0m"
|
||||
fi
|
||||
fi
|
||||
view="${view}\n\e[0;36m${path}\e[0m"
|
||||
view="${view}\n┌ "
|
||||
if [ ${EUID} -eq 0 ]; then
|
||||
view="${view}\e[0;31m"
|
||||
else
|
||||
view="${view}\e[0;32m"
|
||||
fi
|
||||
view="${view}${user}\e[0m @ \e[0;33m${host}\e[0m"
|
||||
echo -e "${view}\n${PS2}"
|
||||
}
|
||||
|
||||
PS1="\$(ps1 \${?})"
|
||||
|
||||
PS2="\
|
||||
├ "
|
Loading…
Add table
Add a link
Reference in a new issue