Files
zsh/68-aliases.zsh
Andrey Astafyev ef8685b3bb refactor(aliases): убрать копии алиасов
* Удаляет копии алиасов для `feh`, `ycal` и `ncdu`.
2026-04-11 14:25:33 +03:00

104 lines
2.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# shellcheck shell=bash
# vim: ft=sh
# zmv
alias zcp='zmv -C'
alias zln='zmv -L'
# shellcheck disable=SC2154
alias path='print -l $path'
alias mkdir='mkdir -pv'
# APT
alias aptu='sudo apt-get update'
alias aptn='sudo apt-get update && sudo apt-get dist-upgrade'
alias apti='sudo apt-get install'
alias aptif='sudo apt-get -f install'
alias aptp='sudo apt-get purge'
alias aptr='sudo apt-get remove'
alias aptc='sudo apt-get --purge autoremove && sudo apt-get clean'
alias aptk='sudo apt-key add'
alias apts='apt-cache show'
aptf() {
[ -z "$1" ] && return 1
if [ -z "$2" ]; then
apt-cache search "$1"
else
apt-cache search "$1" | grep "$2"
fi
}
command -v lazygit > /dev/null 2>&1 && alias lzg='lazygit'
command -v lazydocker > /dev/null 2>&1 && alias lzd='lazydocker'
command -v tealdeer > /dev/null 2>&1 && alias tldr='tealdeer'
# feh
command -v feh > /dev/null 2>&1 && alias feh="feh --cache-size 256 --version-sort --sort filename --image-bg black"
# ycal
command -v ncal > /dev/null 2>&1 && alias ycal="ncal $(date +%Y)"
# gdu вместо ncdu
command -v gdu > /dev/null 2>&1 && alias ncdu=gdu
# Используется плагин из OhMyZsh
alias -g CC='| clipcopy'
alias -g CC0="| perl -p -e 'chomp if eof' | clipcopy"
alias -g CV='$(clippaste)'
# Youtube
if command -v yt-dlp > /dev/null 2>&1; then
alias ydlbest="yt-dlp --merge-output-format mkv -f 'bestvideo+bestaudio'"
alias ydlaudio="yt-dlp -f bestaudio"
alias ydl="yt-dlp --merge-output-format mkv"
alias youtube-dl="yt-dlp"
fi
# Замена шрифта у заголовка окна в i3 при использовании ssh или mosh
if [ -n "${DISPLAY+set}" ] ; then
if command -v i3-msg >/dev/null 2>&1 ; then
i3-mosh () {
i3-msg -q title_format "<span foreground='#AAAAFF' font-weight='bold'>%title</span>"
mosh "$@"
i3-msg -q title_format "%title"
}
alias mosh=i3-mosh
i3-ssh () {
i3-msg -q title_format "<span foreground='#AAAAFF' font-weight='bold'>%title</span>"
ssh "$@"
i3-msg -q title_format "%title"
}
alias ssh=i3-ssh
fi
fi
# git
alias gpa="git remote | xargs -L1 git push --all"
alias gu="git pull"
alias gur="git pull --recurse-submodules"
alias gsui="git submodule update --recursive --init"
alias gsur="git submodule update --recursive --init --remote"
# Фильтры (H,T,G,L определены в common-aliases)
alias -g N1='1>/dev/null'
alias -g N2='2>/dev/null'
alias -g NN='&>/dev/null'
alias -g S='| sort'
alias -g SU='| sort -u'
alias -g S0='| sort -z'
alias -g SU0='| sort -u -z'
alias -g X='| xargs'
alias -g X0='| xargs -0'
alias -g XS='| sort | xargs'
alias -g XS0='| sort -z | xargs -0'
alias -g Z='| fzf'
# shellcheck disable=SC1073,SC1064,SC1072
audio-join() ffmpeg -i "concat:${(j:|:)@[2,-1]}" -acodec copy $1
vob-join() ffmpeg -analyzeduration 300M -probesize 300M -i "concat:${(j:|:)@[2,-1]}" -f concat -c copy $1