Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.
| Порівняння попередніх версій Попередня ревізія Наступна ревізія | Попередня ревізія | ||
|
software:os:terminal:wezterm [2026/03/09 14:31] charon [Для всіх] |
software:os:terminal:wezterm [2026/03/09 18:59] (поточний) charon [Убунту] |
||
|---|---|---|---|
| Рядок 59: | Рядок 59: | ||
| fi | fi | ||
| </ | </ | ||
| - | ===== Додаткові налаштування Zsh ===== | ||
| - | ==== MacOS ==== | ||
| - | додамо корисні плагіни zsh-autosuggestions zsh-syntax-highlighting | ||
| - | <code bash> | ||
| - | brew install zsh-autosuggestions zsh-syntax-highlighting | ||
| - | mkdir -pv ${ZSH_CUSTOM: | ||
| - | ln -s $(brew --prefix)/ | ||
| - | ln -s $(brew --prefix)/ | ||
| - | </ | ||
| - | можливо, | ||
| - | ==== Для всіх ==== | + | ===== Додаткові налаштування Zsh: Аліаси |
| - | відкрити ~/.zshrc | + | основна ідея в тому, щоб |
| - | < | + | ==== Усі ==== |
| - | plugins=( | + | < |
| - | git | + | |
| - | terraform | + | |
| - | direnv | + | |
| - | z | + | |
| - | zsh-autosuggestions | + | |
| - | zsh-syntax-highlighting | + | |
| - | ) | + | |
| - | </ | + | |
| - | можна додати й інші плагіни, але обережно, | + | |
| - | + | ||
| - | Щоб додати аліаси та інше, треба створити файл //${ZSH_CUSTOM: | + | |
| - | <file my-aliases.zsh> | + | |
| - | ### Aliases | + | |
| - | alias ls="/ | + | |
| alias dir=" | alias dir=" | ||
| alias l="ls -la" | alias l="ls -la" | ||
| - | alias ді=ls | ||
| - | alias св=cd | ||
| alias cw=" | alias cw=" | ||
| alias x=" | alias x=" | ||
| Рядок 98: | Рядок 72: | ||
| alias tt=traceroute | alias tt=traceroute | ||
| alias ports=" | alias ports=" | ||
| - | alias monitor_turn_off="xset dpms force off" | + | alias play_alert="afplay ~/ |
| - | alias chromium="/usr/bin/chromium-browser >/dev/null 2>&1 &" | + | alias myip="wget -O - -q icanhazip.com" |
| + | alias batcat=" | ||
| + | alias va=' | ||
| + | alias ve=' | ||
| + | alias list_instances=" | ||
| # Find top 5 big files | # Find top 5 big files | ||
| Рядок 116: | Рядок 94: | ||
| alias ...=' | alias ...=' | ||
| + | # Create and change to a new directory | ||
| + | mcd () | ||
| + | { | ||
| + | if [ " | ||
| + | echo "mcd directory-name"; | ||
| + | else | ||
| + | if [ ! -d $1 ]; then | ||
| + | mkdir $1; | ||
| + | cd $1; | ||
| + | else | ||
| + | echo "$1 directory exists"; | ||
| + | fi; | ||
| + | fi | ||
| + | } | ||
| # display currently mounted file systems nicely | # display currently mounted file systems nicely | ||
| showmounted() { (echo " | showmounted() { (echo " | ||
| - | # EXTENDED | + | # Local aliases |
| - | alias myip=' | + | |
| - | alias zimdate=" | + | |
| - | # List processes grouped by cgroups | + | |
| - | alias psc=' | + | |
| - | # Recursively show control group contents | + | |
| - | alias pss=" | + | |
| alias gfo=" | alias gfo=" | ||
| - | alias list_instances="aws ec2 describe-instances --no-cli-pager --color off --filter Name=tag-key,Values=Name Name=instance-state-name, | + | alias zimdate="LC_TIME=en_US.UTF-8 date '+Week %V%n%A, %d.%m.%Y'" |
| alias apg1=" | alias apg1=" | ||
| alias apg2=" | alias apg2=" | ||
| alias apg3=" | alias apg3=" | ||
| - | alias apg_contabo="apg -a 1 -n 1 -m 20 -x 30 -M NCL -E I1l0O" | + | </ |
| - | alias proxy_nephalia="ssh -D 8888 nephalia" | + | |
| - | alias proxy_kimsufi=" | + | ==== MacOS ==== |
| - | alias proxy_vps="ssh -D 8888 hastur" | + | <file zsh my-aliases.zsh> |
| - | [ -f /usr/bin/batcat ] && | + | # Exit if it's not MacOS |
| - | alias cal="ncal -w" | + | [[ "$(uname |
| - | alias play_sound="aplay ~/ | + | |
| - | alias va='source ./ | + | # Configuration if Brew installed |
| - | alias ve='python3 | + | () { |
| + | local bp="" | ||
| + | [[ -x / | ||
| + | [[ -x / | ||
| + | |||
| + | if [[ -n " | ||
| + | export HOMEBREW_AUTO_UPDATE_SECS=86400 | ||
| + | export HOMEBREW_NO_ANALYTICS=1 | ||
| + | |||
| + | if (( $+commands[gls] )); then | ||
| + | # Використовуємо локальну змінну для аліасів | ||
| + | alias ls=" | ||
| + | alias date="$bp/ | ||
| + | else | ||
| + | [[ -t 1 ]] && echo "\e[33mNotice: | ||
| + | fi | ||
| + | fi | ||
| + | } | ||
| + | |||
| + | alias openfinder=' | ||
| + | alias flushdns=' | ||
| + | alias cleanup="find . -type f -name ' | ||
| + | alias battery=" | ||
| + | </ | ||
| + | |||
| + | ==== Убунту ==== | ||
| + | <file zsh my-aliases-ubuntu.zsh> | ||
| + | alias ls='/bin/ls --color=never -F --group-directories-first' | ||
| + | alias pbcopy="$HOME/ | ||
| + | alias monitor_turn_off=' | ||
| + | alias play_sound='aplay ~/ | ||
| + | alias psc='ps xawf -eo pid, | ||
| + | alias pss='systemd-cgls' | ||
| alias tree=' | alias tree=' | ||
| - | alias show_flac_bitrate=" | ||
| - | alias veracrypt_mount=" | ||
| - | alias veracrypt_umount=" | ||
| - | alias typora=" | ||
| - | # update packages | ||
| if [[ -f / | if [[ -f / | ||
| if grep -q " | if grep -q " | ||
| - | # alias update=" | ||
| alias update=" | alias update=" | ||
| alias update_small=" | alias update_small=" | ||
| Рядок 158: | Рядок 171: | ||
| fi | fi | ||
| fi | fi | ||
| + | </ | ||
| - | # Zsh-specific aliases | + | ==== MacOS ==== |
| - | alias icat=' | + | додамо корисні плагіни zsh-autosuggestions zsh-syntax-highlighting |
| - | # preview all images in current directory | + | <code bash> |
| - | icatdir() { | + | brew install zsh-autosuggestions zsh-syntax-highlighting |
| - | for img in *.{png, | + | mkdir -pv ${ZSH_CUSTOM: |
| - | echo "--- $img ---" | + | ln -s $(brew --prefix)/ |
| - | | + | ln -s $(brew |
| - | | + | </ |
| - | } | + | можливо, |
| - | # Zsh-specific suffix aliases | + | ==== Для всіх ==== |
| - | alias -s png=" | + | відкрити ~/.zshrc |
| - | alias -s jpg=" | + | < |
| - | alias -s jpeg=" | + | plugins=( |
| - | alias -s gif=" | + | git |
| - | alias -s bmp=" | + | |
| - | alias -s webp=" | + | |
| - | alias -s ico=" | + | z |
| - | alias -s md=" | + | zsh-autosuggestions |
| - | #alias -s epub=' | + | zsh-syntax-highlighting |
| - | alias -s mobi=' | + | ) |
| - | alias -s azw3=' | + | </code> |
| - | alias -s fb2=' | + | можна додати й інші плагіни, |
| - | alias -s djvu=' | + | |
| - | alias -s cbz=' | + | |
| - | alias -s cbr=' | + | |
| - | alias -s js=' | + | |
| - | alias -s yaml=' | + | |
| - | alias -s yml=' | + | |
| - | alias -s toml='code' | + | |
| - | # open pdf in okular (default KDE viewer) instead of calibre | + | |
| - | alias -s pdf=' | + | |
| - | # Calibre Viewer | + | Щоб додати аліаси та інше, треба створити файл //${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/my-aliases.zsh// (ім'я на свій смак) і в нього додати: |
| - | _ebook_open() | + | |
| - | ebook-viewer " | + | |
| - | local viewer_pid=$! | + | |
| - | + | ||
| - | # wait for window with this PID to appear (max 10 seconds) | + | |
| - | local timeout=10 | + | |
| - | local waited=0 | + | |
| - | until wmctrl | + | |
| - | sleep 0.3 | + | |
| - | (( waited++ )) | + | |
| - | done | + | |
| - | + | ||
| - | ~/scripts/align-window.sh center 40 " | + | |
| - | } | + | |
| - | + | ||
| - | alias -s epub='_ebook_open' | + | |
| - | + | ||
| - | ### Functions | + | |
| - | # Create and change to a new directory | + | |
| - | mcd () | + | |
| - | { | + | |
| - | if [ " | + | |
| - | echo "mcd directory-name"; | + | |
| - | | + | |
| - | if [ ! -d $1 ]; then | + | |
| - | mkdir $1; | + | |
| - | cd $1; | + | |
| - | | + | |
| - | echo "$1 directory exists"; | + | |
| - | fi; | + | |
| - | fi | + | |
| - | } | + | |
| - | </ | + | |
| ===== Посилання ===== | ===== Посилання ===== | ||
| * [[https:// | * [[https:// | ||