addet some aliases?

This commit is contained in:
pika 2024-07-30 19:17:00 +02:00
parent 45f4c0aa3a
commit 0f3d2cd489
3 changed files with 88 additions and 45 deletions

View file

@ -56,9 +56,9 @@ end
# ─< colorized ls >─────────────────────────────────────────────────────────────────────────
# ─< lsd >──────────────────────────────────────────────────────────────────────────────────
if command -v lsd >/dev/null 2>&1
alias ls="lsd --long --git"
alias l="lsd -1 --almost-all"
alias ll="lsd -lA"
alias ls="lsd -l -1 -h1 --almost-all --git"
alias l="lsd -1"
alias ll="lsd -1 --almost-all"
alias clearl="command clear && l"
alias tree="lsd --tree"
else
@ -77,9 +77,9 @@ else
alias tree="eza --icons -l -tree"
else
# ─< if nothing works -- plain old ls >─────────────────────────────────────────────────────
alias ls="ls --color=always -lph"
alias l="ls --color=always -lph"
alias ll="ls --color=always -lAph"
alias ls="ls --color=always -lAph"
alias l="ls --color=always -lph -w1"
alias ll="ls --color=always -lph"
end
end
end
@ -108,8 +108,40 @@ if command -v telnet >/dev/null 2>&1
end
# ─< rsync >────────────────────────────────────────────────────────────────────────────────
function _rsync
# Check if the 'find' command exists
if command -v find >/dev/null 2>&1
# Initialize the number of files to 0
set numbers 0
# Loop through all arguments except the last one (which is the destination)
for source in $argv[1..-2]
# Count the number of files in the source directory
set numbers (math $numbers + (find $source -type f | wc -l))
end
# Set the destination (last argument)
set destination $argv[-1]
# Set the color to magenta
set_color magenta
# Use rsync with pv for progress
rsync -avP --info=progress2 $argv[1..-2] $destination | pv -lpes $numbers
# Reset the color to normal
set_color normal
else
# If 'find' is not installed, display a warning message
echo "We could not find 'find'. Please install 'find' to enable the progress bar. (hit 'CTRL + C' to exit now)"
sleep 5
# Run rsync without progress bar
rsync -avP --info=progress2 $argv
end
end
if command -v rsync >/dev/null 2>&1
alias cp="rsync -avP --info=progress2"
alias cp="_rsync"
alias scp="rsync -avP"
end