2022-02-10 20:11:56 +01:00
|
|
|
#--------------------------------
|
|
|
|
# filename: /zsh/alias
|
|
|
|
#--------------------------------
|
|
|
|
|
|
|
|
# Better LS
|
|
|
|
if [[ $platform == 'Linux' ]]; then
|
|
|
|
alias bls='pwd; ls -lahp --color=auto --group-directories-first'
|
2022-11-13 19:19:00 +01:00
|
|
|
elif [[ $platform == 'macOS' && -x $(which gls) ]]; then
|
2022-02-10 20:11:56 +01:00
|
|
|
alias bls='pwd; gls -lahpG --group-directories-first'
|
|
|
|
elif [[ $platform == 'macOS' ]]; then
|
|
|
|
alias bls='/bin/ls -lahG'
|
|
|
|
fi
|
|
|
|
|
2023-09-08 02:52:53 +02:00
|
|
|
# Better eza
|
|
|
|
if [[ -x $(which eza) ]]; then
|
|
|
|
alias eza='pwd; eza --long --all --all --group-directories-first --git --group'
|
2023-09-04 03:52:51 +02:00
|
|
|
# --all (2x) to show `.` and `..` directories as well
|
2022-02-10 20:11:56 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Better lsd
|
2022-11-13 19:19:00 +01:00
|
|
|
if [[ -x $(which lsd) ]]; then
|
2022-02-20 17:58:05 +01:00
|
|
|
alias lsd='pwd; lsd -laF --group-dirs=first --icon=never'
|
2022-02-10 20:11:56 +01:00
|
|
|
fi
|
|
|
|
|
2022-11-15 10:14:02 +01:00
|
|
|
# Update tools/OS aliases
|
2022-11-13 19:19:00 +01:00
|
|
|
if [[ -x $(which brew) ]]; then
|
2022-02-10 20:11:56 +01:00
|
|
|
alias brewupdate='brew update; brew upgrade; brew upgrade --cask; brew cleanup'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $platform == 'Linux' ]]; then
|
2024-04-07 17:34:09 +02:00
|
|
|
alias aptupdate='sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt clean'
|
2022-02-10 20:11:56 +01:00
|
|
|
fi
|
|
|
|
|
2022-04-19 15:34:47 +02:00
|
|
|
# tmux
|
2023-04-27 20:28:08 +02:00
|
|
|
alias tm='tmux -u new -A -s default'
|
2022-04-19 15:34:47 +02:00
|
|
|
|
2022-02-10 20:11:56 +01:00
|
|
|
# For fun
|
|
|
|
alias fucking='sudo'
|
|
|
|
alias please='sudo'
|
|
|
|
|
|
|
|
# aria2c
|
|
|
|
alias a2='aria2c -x4 -c -m3'
|
|
|
|
|
|
|
|
# screen reconnect/init
|
|
|
|
alias sc='screen -R'
|
|
|
|
|
2022-11-15 10:14:02 +01:00
|
|
|
# youtube-dl / yt-dlp
|
2022-11-13 19:19:00 +01:00
|
|
|
if [[ -x $(which yt-dlp) ]]; then
|
2024-07-05 10:33:12 +02:00
|
|
|
alias ydl='yt-dlp'
|
2022-11-13 19:19:00 +01:00
|
|
|
elif [[ -x $(which youtube-dl) ]]; then
|
2024-07-05 10:33:12 +02:00
|
|
|
alias ydl='youtube-dl'
|
2022-05-24 15:26:27 +02:00
|
|
|
fi
|
|
|
|
|
2022-11-15 10:14:02 +01:00
|
|
|
# youtube-dl(p) - Download only best MP4
|
|
|
|
alias ytmp4='ydl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4"'
|
|
|
|
|
2022-02-10 20:11:56 +01:00
|
|
|
# better scp
|
|
|
|
alias bcp='rsync -avzuh --progress --partial'
|
|
|
|
|
|
|
|
# generate pseudo-random hash
|
2022-11-13 19:19:00 +01:00
|
|
|
alias random32='echo $(date +%s | md5sum | head -c 32)'
|
2022-02-10 20:11:56 +01:00
|
|
|
|
2023-09-08 02:53:12 +02:00
|
|
|
# tar extract
|
2022-02-10 20:11:56 +01:00
|
|
|
alias untargz='tar -xzvf'
|
|
|
|
|
2022-06-16 23:30:46 +02:00
|
|
|
# (macOS) start Firefox Profile manager
|
2022-11-13 19:19:00 +01:00
|
|
|
if test -x '/Applications/Firefox.app/Contents/MacOS/firefox-bin'; then
|
2022-06-16 23:30:46 +02:00
|
|
|
alias firefox-pm='/Applications/Firefox.app/Contents/MacOS/firefox-bin -P'
|
|
|
|
fi
|
|
|
|
|
2023-06-08 22:22:32 +02:00
|
|
|
# zspotify (Docker)
|
2023-06-08 22:44:20 +02:00
|
|
|
alias zspotify='docker run -v ${HOME}/.zspotify:/root/.zspotify -v ${HOME}/Music:/root/Music -it jsavargas/zspotify'
|
2022-06-16 23:30:46 +02:00
|
|
|
|
2022-09-07 23:47:58 +02:00
|
|
|
# git
|
|
|
|
alias gadd='git add'
|
|
|
|
alias gclone='git clone'
|
|
|
|
alias gpull='git pull'
|
|
|
|
alias gpush='git push'
|
|
|
|
alias gcommit='git commit -m'
|
|
|
|
|
2023-08-22 08:14:11 +02:00
|
|
|
# docker
|
|
|
|
alias dcdu='docker compose down && docker compose up -d'
|
|
|
|
|
2022-02-10 20:11:56 +01:00
|
|
|
# linux stuff
|
|
|
|
alias journ='journalctl -xfe -t'
|
|
|
|
|
|
|
|
# own this dir (+subs)
|
|
|
|
alias makeitmine='sudo chown -R $(whoami) ./'
|
|
|
|
|
|
|
|
# ---
|
|
|
|
# .dotfiles
|
|
|
|
|
|
|
|
alias dotf='cd ~/.dotfiles'
|
|
|
|
alias dotfu='cd ~/.dotfiles; git pull; cd -; source ~/.zshrc'
|
2022-09-07 23:11:45 +02:00
|
|
|
alias reload-zsh='source ~/.zshrc'
|