Fix ZSH aliases
This commit is contained in:
@@ -1,29 +1,15 @@
|
|||||||
is_debian_based() {
|
pbcopy() {
|
||||||
# Checking /etc/os-release
|
if [ -f "$1" ]; then
|
||||||
if [[ -f /etc/os-release ]]; then
|
mime_type=$(file --mime-type -b "$1")
|
||||||
. /etc/os-release
|
wl-copy --type "$mime_type" < "$1"
|
||||||
if [[ "$ID_LIKE" == *"debian"* ]] || [[ "$ID" == "debian" ]]; then
|
else
|
||||||
return 0 # OK: Debian-based
|
printf "%s" "$*" | wl-copy
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Alternative check: /etc/debian_version
|
|
||||||
if [[ -f /etc/debian_version ]]; then
|
|
||||||
return 0 # OK: Debian-based
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 1 # NO Debian-based
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alias pbpaste='wl-paste --no-newline'
|
||||||
alias ls="eza --color=always --group-directories-first --icons=always"
|
alias ls="eza --color=always --group-directories-first --icons=always"
|
||||||
|
alias cat='bat --style header --style snip --style changes --pager never'
|
||||||
# Replace some more things with better alternatives
|
|
||||||
if is_debian_based; then
|
|
||||||
alias bat='batcat'
|
|
||||||
alias fd='fdfind'
|
|
||||||
fi
|
|
||||||
|
|
||||||
alias cat='bat --style header --style snip --style changes --style header --pager never'
|
|
||||||
|
|
||||||
# Replace df command tool
|
# Replace df command tool
|
||||||
alias df='duf'
|
alias df='duf'
|
||||||
@@ -41,6 +27,4 @@ alias fgrep='ugrep -F --color=auto'
|
|||||||
alias paths='echo -e ${PATH//:/\\n}' # path: Echo all executable Paths
|
alias paths='echo -e ${PATH//:/\\n}' # path: Echo all executable Paths
|
||||||
alias userlist="cut -d: -f1 /etc/passwd | sort"
|
alias userlist="cut -d: -f1 /etc/passwd | sort"
|
||||||
alias ip='ip -color'
|
alias ip='ip -color'
|
||||||
alias pbcopy='xsel --clipboard --input'
|
|
||||||
alias pbpaste='xsel --clipboard --output'
|
|
||||||
alias stow='stow -d $DOTFILES '
|
alias stow='stow -d $DOTFILES '
|
||||||
|
|||||||
Reference in New Issue
Block a user