This commit is contained in:
2025-03-30 01:32:05 +04:00
parent fc75c3ef8b
commit 4ba1e8cad0
3 changed files with 40 additions and 2 deletions

24
.bashrc
View File

@@ -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
View File

@@ -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

View File

@@ -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 "