fix(bash-aliases): compatible with bash and zsh, disable beeper in tty

This commit is contained in:
TheK4n 2023-11-14 16:31:52 +03:00
parent 749c813c63
commit e475a58b4b
3 changed files with 7 additions and 6 deletions

View File

@ -5,20 +5,18 @@ if [ -x "$(which dircolors)" ]; then
alias dir='dir --color=auto' alias dir='dir --color=auto'
alias vdir='vdir --color=auto' alias vdir='vdir --color=auto'
alias grep='grep --color=auto' alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto' alias fgrep='fgrep --color=auto'
alias ls='ls --color=auto' alias ls='ls --color=auto'
fi fi
# these aliases use the "ls" alias, which was defined earlier
alias l.='ls -AF --ignore="*"' alias l.='ls -AF --ignore="*"'
alias ll='ls -lhF' alias ll='ls -lhF'
alias la='ls -AF' alias la='ls -AF'
alias lt='du -sh * | sort -h' alias lt='du -sh * | sort -h'
alias rm='rm -r' alias rm='rm -ir'
alias mkdir='mkdir -pv' alias mkdir='mkdir -pv'
alias cd..='cd ..' alias cd..='cd ..'

View File

@ -1,4 +1,4 @@
_f() {} _f() { true ; }
# colors # colors
if [ -x "$(command -v dircolors)" ]; then if [ -x "$(command -v dircolors)" ]; then
@ -16,7 +16,7 @@ alias ll='ls -lhFv'
alias la='ls -AFv' alias la='ls -AFv'
alias lla='ls -lhFAv' alias lla='ls -lhFAv'
alias ll.='ls -lhFAv --ignore="*"' alias ll.='ls -lhFAv --ignore="*"'
alias lsl='_f() { ls -lhFA --color=always "${1:=.}" | tail -n +2 | bash -c "$PAGER" }; _f' alias lsl='_f() { ls -lhFA --color=always "${1:=.}" | tail -n +2 | bash -c "$PAGER" ; }; _f'
alias _='sudo' alias _='sudo'
@ -30,7 +30,7 @@ alias ..='cd ..'
alias ...='cd ../..' alias ...='cd ../..'
alias ....='cd ../../..' alias ....='cd ../../..'
alias .3='cd ../../..' alias .3='cd ../../..'
alias cl='_f() { cd "${1:=$HOME}" && ls -F --color=auto }; _f' alias cl='_f() { cd "${1:=$HOME}" && ls -F --color=auto ; }; _f'
alias path='echo -e ${PATH//:/\\n}' alias path='echo -e ${PATH//:/\\n}'

View File

@ -1,3 +1,6 @@
if [[ "$TTY" =~ /dev/tty* ]]; then
setterm -blength=0
fi
if systemctl -q is-active graphical.target && [[ $(tty) = "/dev/tty1" ]] && [[ -z $DISPLAY ]] && [[ $XDG_VTNR -eq 1 ]]; then if systemctl -q is-active graphical.target && [[ $(tty) = "/dev/tty1" ]] && [[ -z $DISPLAY ]] && [[ $XDG_VTNR -eq 1 ]]; then
exec startx >> ~/.xlogs 2>&1 exec startx >> ~/.xlogs 2>&1