From e475a58b4bad0b2636347c403b7c9ff6d479c146 Mon Sep 17 00:00:00 2001 From: Thek4n Date: Tue, 14 Nov 2023 16:31:52 +0300 Subject: [PATCH] fix(bash-aliases): compatible with bash and zsh, disable beeper in tty --- etc/skel/.bashrc | 4 +--- home/user/.config/bash/aliases | 6 +++--- home/user/.zprofile | 3 +++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/etc/skel/.bashrc b/etc/skel/.bashrc index 8351072..4ad3840 100644 --- a/etc/skel/.bashrc +++ b/etc/skel/.bashrc @@ -5,20 +5,18 @@ if [ -x "$(which dircolors)" ]; then alias dir='dir --color=auto' alias vdir='vdir --color=auto' alias grep='grep --color=auto' - alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias ls='ls --color=auto' fi -# these aliases use the "ls" alias, which was defined earlier alias l.='ls -AF --ignore="*"' alias ll='ls -lhF' alias la='ls -AF' alias lt='du -sh * | sort -h' -alias rm='rm -r' +alias rm='rm -ir' alias mkdir='mkdir -pv' alias cd..='cd ..' diff --git a/home/user/.config/bash/aliases b/home/user/.config/bash/aliases index f35eac9..23a0ea7 100644 --- a/home/user/.config/bash/aliases +++ b/home/user/.config/bash/aliases @@ -1,4 +1,4 @@ -_f() {} +_f() { true ; } # colors if [ -x "$(command -v dircolors)" ]; then @@ -16,7 +16,7 @@ alias ll='ls -lhFv' alias la='ls -AFv' alias lla='ls -lhFAv' 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' @@ -30,7 +30,7 @@ alias ..='cd ..' alias ...='cd ../..' alias ....='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}' diff --git a/home/user/.zprofile b/home/user/.zprofile index e8c05ee..79fee3a 100644 --- a/home/user/.zprofile +++ b/home/user/.zprofile @@ -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 exec startx >> ~/.xlogs 2>&1