mirror of
https://github.com/1xtier/.dotfiles.git
synced 2026-03-17 02:47:56 +00:00
edit
This commit is contained in:
22
.bashrc
22
.bashrc
@@ -1,5 +1,26 @@
|
||||
# .bashrc
|
||||
# COnfigure PS1 Begin
|
||||
INPUT_COLOR="\[\033[0m\]"
|
||||
DIR_COLOR="\[\033[0;33m\]"
|
||||
DIR="\w"
|
||||
LINE_VC="\342\224\200"
|
||||
LINE_CN_1="\342\224\214"
|
||||
LINE_CN_2="\342\224\224"
|
||||
LINE_CR="\[\033[0;37m\]"
|
||||
USER="\[\033[0;35m\]\u@"
|
||||
HOST="\[\033[0;32m\]<\h>"
|
||||
SYMBOL="\[\033[0;32m\]"
|
||||
TEST="\[\033[0m\]>"
|
||||
|
||||
if [[ ${EUID} == 0 ]]; then
|
||||
USER="\[\033[0;31m\]\u@"
|
||||
HOST="\[\033[0;32m\]\h"
|
||||
SYMBOL="\[\033[0;31m\]"
|
||||
TEST="\[\033[0m\]>>"
|
||||
fi
|
||||
|
||||
export PS1="$LINE_CR$LINE_CN_1$LINE_VC $USER$HOST $DIR_COLOR$DIR \n$LINE_CR$LINE_CN_2$LINE_VC $SYMBOL$TEST $INPUT_COLOR"
|
||||
# Configure PS1 end
|
||||
# Source global definitions
|
||||
if [ -f /etc/bashrc ]; then
|
||||
. /etc/bashrc
|
||||
@@ -10,7 +31,6 @@ if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
|
||||
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
|
||||
fi
|
||||
export PATH
|
||||
export PS1="\e[0;34m\u\e[0m:\e[0;31m\h\e[0m\e[0;32m:\W> \e[0m"
|
||||
|
||||
# Uncomment the following line if you don't like systemctl's auto-paging feature:
|
||||
# export SYSTEMD_PAGER=
|
||||
|
||||
17
.zshrc
17
.zshrc
@@ -98,6 +98,23 @@ done | sort
|
||||
return 0
|
||||
}
|
||||
compdef myalias
|
||||
sshc() {
|
||||
local RED=$(tput setaf 1)
|
||||
local GREEN=$(tput setaf 2)
|
||||
local normal=$(tput sgr0)
|
||||
echo "My custom aliases SSH-config:"
|
||||
printf "%-18s %s\n" "Name" "Hostname"
|
||||
echo "------------------------------"
|
||||
# cat ~/.ssh/config.d/$1.conf | while read line || [[ -n $line ]];
|
||||
# do
|
||||
for file in ~/.ssh/config.d/$1.conf; do
|
||||
host=$(grep -w 'Host' $file | awk '{print $2}')
|
||||
command=$(grep -w 'HostName' $file | awk '{print $2}')
|
||||
printf "%-25s %s\n" "${RED}$host${normal}" "${GREEN}$command${normal}"
|
||||
done
|
||||
return 0
|
||||
}
|
||||
compdef myalias
|
||||
# Load files alias
|
||||
if [ -f ~/.dotfiles/alias/zsh_aliases ]; then
|
||||
. ~/.dotfiles/alias/zsh_aliases
|
||||
|
||||
@@ -13,3 +13,4 @@ alias gc='git commit -m'
|
||||
alias gp="git push"
|
||||
alias T="tmux attach -t Work || tmux new -s Work"
|
||||
alias t-help="~/.dotfiles/sh/./tmux-help"
|
||||
alias ccom="sudo minicom -b $1 -D /dev/tty$2 "
|
||||
|
||||
Reference in New Issue
Block a user