2020-02-10 21:08:33 -06:00
|
|
|
# # ex - archive extractor
|
|
|
|
# # usage: ex <file>
|
|
|
|
ex ()
|
|
|
|
{
|
|
|
|
if [ -f $1 ] ; then
|
|
|
|
case $1 in
|
|
|
|
*.tar.bz2) tar xjf $1 ;;
|
|
|
|
*.tar.gz) tar xzf $1 ;;
|
2020-06-11 13:22:11 -05:00
|
|
|
*.tar.xz) tar xJf $1 ;;
|
2020-02-10 21:08:33 -06:00
|
|
|
*.bz2) bunzip2 $1 ;;
|
2020-06-07 21:08:06 +02:00
|
|
|
*.rar) unrar x $1 ;;
|
2020-02-10 21:08:33 -06:00
|
|
|
*.gz) gunzip $1 ;;
|
|
|
|
*.tar) tar xf $1 ;;
|
|
|
|
*.tbz2) tar xjf $1 ;;
|
|
|
|
*.tgz) tar xzf $1 ;;
|
|
|
|
*.zip) unzip $1 ;;
|
|
|
|
*.Z) uncompress $1;;
|
|
|
|
*.7z) 7z x $1 ;;
|
|
|
|
*) echo "'$1' cannot be extracted via ex()" ;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
echo "'$1' is not a valid file"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-06-07 21:36:14 +02:00
|
|
|
pacmanupdate ()
|
|
|
|
{
|
2023-02-27 07:06:05 +01:00
|
|
|
echo -n "Enter the country code for the mirrorlist you want to use (default: CZ): "
|
|
|
|
read -t 10 update;
|
|
|
|
if [ -z "$update" ]; then
|
|
|
|
update=CZ;
|
|
|
|
fi
|
2020-06-07 21:36:14 +02:00
|
|
|
sudo reflector -c $update -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist;
|
|
|
|
}
|
|
|
|
|
2022-01-09 04:42:33 +01:00
|
|
|
alias ls='ls --color'
|
2020-02-10 21:08:33 -06:00
|
|
|
alias ll='ls -l'
|
|
|
|
# ls, the common ones I use a lot shortened for rapid fire usage
|
2020-07-08 22:48:39 -05:00
|
|
|
alias l='ls -lFh' #size,show type,human readable
|
|
|
|
alias la='ls -lAFh' #long list,show almost all,show type,human readable
|
|
|
|
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
|
|
|
|
alias lt='ls -ltFh' #long list,sorted by date,show type,human readable
|
|
|
|
alias ll='ls -l' #long list
|
|
|
|
alias ldot='ls -ld .*'
|
|
|
|
alias lS='ls -1FSsh'
|
|
|
|
alias lart='ls -1Fcart'
|
|
|
|
alias lrt='ls -1Fcrt'
|
2020-02-10 21:08:33 -06:00
|
|
|
|
|
|
|
alias zshrc='${=EDITOR} ~/.zshrc' # Quick access to the ~/.zshrc file
|
|
|
|
|
|
|
|
alias grep='grep --color'
|
|
|
|
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
|
|
|
|
|
|
|
|
alias t='tail -f'
|
|
|
|
|
|
|
|
# Command line head / tail shortcuts
|
|
|
|
alias -g H='| head'
|
|
|
|
alias -g T='| tail'
|
|
|
|
alias -g G='| grep'
|
|
|
|
alias -g L="| less"
|
|
|
|
alias -g M="| most"
|
|
|
|
alias -g LL="2>&1 | less"
|
|
|
|
alias -g CA="2>&1 | cat -A"
|
|
|
|
alias -g NE="2> /dev/null"
|
|
|
|
alias -g NUL="> /dev/null 2>&1"
|
|
|
|
alias -g P="2>&1| pygmentize -l pytb"
|
|
|
|
|
|
|
|
alias dud='du -d 1 -h'
|
|
|
|
alias duf='du -sh *'
|
|
|
|
alias fd='find . -type d -name'
|
|
|
|
alias ff='find . -type f -name'
|
|
|
|
|
|
|
|
alias h='history'
|
|
|
|
alias hgrep="fc -El 0 | grep"
|
|
|
|
alias help='man'
|
|
|
|
alias p='ps -f'
|
|
|
|
alias sortnr='sort -n -r'
|
|
|
|
alias unexport='unset'
|
|
|
|
|
2023-11-06 14:17:31 +01:00
|
|
|
# Use trash instead of rm if available
|
|
|
|
if command -v trash &> /dev/null
|
|
|
|
then
|
|
|
|
alias rm='trash'
|
|
|
|
else
|
|
|
|
alias rm='rm -i'
|
|
|
|
fi
|
|
|
|
|
2020-02-10 21:08:33 -06:00
|
|
|
alias cp='cp -i'
|
|
|
|
alias mv='mv -i'
|
2020-10-09 20:30:40 +02:00
|
|
|
|
2023-02-27 07:06:05 +01:00
|
|
|
# alias update-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg'
|
2023-11-06 14:11:15 +01:00
|
|
|
alias firefox='GTK_USE_PORTAL=1 firefox'
|
|
|
|
|
2021-11-14 18:37:36 +01:00
|
|
|
alias cls="clear"
|
2022-01-09 04:42:33 +01:00
|
|
|
|
|
|
|
alias sshc='ssh-connect'
|
2023-11-06 13:58:16 +01:00
|
|
|
|
|
|
|
# Kitty binds
|
|
|
|
if [ "$TERM" = "xterm-kitty" ]; then
|
2023-11-10 15:49:09 +01:00
|
|
|
alias ssh="kitty +kitten ssh"
|
|
|
|
alias icat="kitty +kitten icat"
|
|
|
|
alias d="kitty +kitten diff"
|
|
|
|
alias get="kitty +kitten transfer"
|
|
|
|
alias put="kitty +kitten transfer --direction=upload"
|
|
|
|
alias kclip="kitty +kitten clipboard"
|
2023-11-06 13:58:16 +01:00
|
|
|
fi
|
2023-11-06 14:10:24 +01:00
|
|
|
|
|
|
|
if command -v lsd &> /dev/null
|
|
|
|
then
|
|
|
|
alias ls="lsd"
|
|
|
|
fi
|