From 3e8b78f30dd903672589e1a550763075563af438 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Sat, 9 Aug 2025 16:16:21 +0200 Subject: [PATCH] Fix ZSH aliases --- zsh/.oh-my-zsh/custom/aliases.zsh | 34 ++++++++----------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/zsh/.oh-my-zsh/custom/aliases.zsh b/zsh/.oh-my-zsh/custom/aliases.zsh index 1e41d08..007eea6 100644 --- a/zsh/.oh-my-zsh/custom/aliases.zsh +++ b/zsh/.oh-my-zsh/custom/aliases.zsh @@ -1,29 +1,15 @@ -is_debian_based() { - # Checking /etc/os-release - if [[ -f /etc/os-release ]]; then - . /etc/os-release - if [[ "$ID_LIKE" == *"debian"* ]] || [[ "$ID" == "debian" ]]; then - return 0 # OK: Debian-based - fi - fi - - # Alternative check: /etc/debian_version - if [[ -f /etc/debian_version ]]; then - return 0 # OK: Debian-based - fi - - return 1 # NO Debian-based +pbcopy() { + if [ -f "$1" ]; then + mime_type=$(file --mime-type -b "$1") + wl-copy --type "$mime_type" < "$1" + else + printf "%s" "$*" | wl-copy + fi } +alias pbpaste='wl-paste --no-newline' alias ls="eza --color=always --group-directories-first --icons=always" - -# 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' +alias cat='bat --style header --style snip --style changes --pager never' # Replace df command tool 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 userlist="cut -d: -f1 /etc/passwd | sort" alias ip='ip -color' -alias pbcopy='xsel --clipboard --input' -alias pbpaste='xsel --clipboard --output' alias stow='stow -d $DOTFILES '