Compare commits
10 Commits
6b7dd340c4
...
b551e74961
| Author | SHA1 | Date | |
|---|---|---|---|
| b551e74961 | |||
| 1d34037dff | |||
| 76c0e2c82c | |||
| 0130317102 | |||
| 5b08dd1e63 | |||
| 555f3c5ea8 | |||
| dc208ab453 | |||
| 4fd2169d0d | |||
| d5f85a724c | |||
| b1dd14fa7b |
20
bashrc
20
bashrc
@@ -15,12 +15,11 @@ if [ -z "$BASHRCSOURCED" ]; then
|
||||
# are we an interactive shell?
|
||||
if [ "$PS1" ]; then
|
||||
if [ -z "$PROMPT_COMMAND" ]; then
|
||||
declare -a PROMPT_COMMAND
|
||||
case $TERM in
|
||||
xterm*|vte*)
|
||||
xterm*)
|
||||
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
|
||||
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
|
||||
elif [ "${VTE_VERSION:-0}" -ge 3405 ]; then
|
||||
PROMPT_COMMAND="__vte_prompt_command"
|
||||
else
|
||||
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
|
||||
fi
|
||||
@@ -39,9 +38,9 @@ if [ -z "$BASHRCSOURCED" ]; then
|
||||
fi
|
||||
# Turn on parallel history
|
||||
shopt -s histappend
|
||||
history -a
|
||||
# Turn on checkwinsize
|
||||
shopt -s checkwinsize
|
||||
# Change the default prompt string
|
||||
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
|
||||
# You might want to have e.g. tty in prompt (e.g. more virtual machines)
|
||||
# and console windows
|
||||
@@ -67,15 +66,8 @@ if [ -z "$BASHRCSOURCED" ]; then
|
||||
esac
|
||||
}
|
||||
|
||||
# By default, we want umask to get set. This sets it for non-login shell.
|
||||
# Current threshold for system reserved uid/gids is 200
|
||||
# You could check uidgid reservation validity in
|
||||
# /usr/share/doc/setup-*/uidgid file
|
||||
if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
|
||||
umask 002
|
||||
else
|
||||
umask 022
|
||||
fi
|
||||
# Set default umask for non-login shell only if it is set to 0
|
||||
[ `umask` -eq 0 ] && umask 022
|
||||
|
||||
SHELL=/bin/bash
|
||||
# Only display echos from profile.d scripts if we are no login shell
|
||||
@@ -100,6 +92,6 @@ fi
|
||||
|
||||
|
||||
# Include customized configurations for interactive shell
|
||||
if [ "$PS1" = "[\u@\h \W]\\$ " ]; then
|
||||
if [ "$PS1" ]; then
|
||||
source /etc/bashrc.cust
|
||||
fi
|
||||
|
||||
16
bashrc.cust
16
bashrc.cust
@@ -1,7 +1,7 @@
|
||||
# Custom configuration file
|
||||
|
||||
# Prompt configuration
|
||||
PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"(\[\033[0;31m\]\342\234\227\[\033[0;31m\])\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root'; else echo '\[\033[0;39m\]\u'; fi)\[\033[01;33m\]@\[\033[01;96m\]\h\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]"
|
||||
PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"(\[\033[0;31m\]\342\234\227\[\033[0;31m\])\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root'; else echo '\[\033[0;39m\]\u'; fi)\[\033[01;33m\]@\[\033[01;96m\]\H\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]"
|
||||
|
||||
|
||||
# Attibutes
|
||||
@@ -11,6 +11,7 @@ shopt -s checkjobs
|
||||
|
||||
|
||||
# Variables
|
||||
export HISTCONTROL="ignoredups:ignorespace"
|
||||
export LESSHISTFILE=-
|
||||
|
||||
|
||||
@@ -19,8 +20,9 @@ alias c='bat -n'
|
||||
alias dd='dd status=progress'
|
||||
alias e='nano'
|
||||
alias grep='grep --color=auto -i'
|
||||
alias l='ls'
|
||||
alias la='ls -A'
|
||||
alias l='ls --group-directories-first'
|
||||
alias la='ls -A --group-directories-first'
|
||||
alias man='man -P "bat -p -l man"'
|
||||
alias o='xdg-open'
|
||||
alias r='rm -fr'
|
||||
alias repoinit='repo init --no-clone-bundle'
|
||||
@@ -34,3 +36,11 @@ function cust-error {
|
||||
echo "ERROR: Invalid argument(s)!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function findstring {
|
||||
find . -type f -exec grep --color=auto -i "$@" "{}" +
|
||||
}
|
||||
|
||||
function getalias {
|
||||
alias "$1" |cut -d "=" -f 2- |sed "s/.//; s/.$//"
|
||||
}
|
||||
Reference in New Issue
Block a user