Це стара версія документу!
Гарний сучасний термінал, працює в усіх десктопних ОС: Linux, Windows MacOs, FreeBSD.
можна через репозиторій:
curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg echo 'deb [signed-by=/usr/share/keyrings/wezterm-fury.gpg] https://apt.fury.io/wez/ * *' | sudo tee /etc/apt/sources.list.d/wezterm.list sudo chmod 644 /usr/share/keyrings/wezterm-fury.gpg sudo apt update sudo apt install wezterm
brew install wezterm
sudo apt install zsh zsh-doc zsh-autosuggestions zsh-syntax-highlighting
в MacOS нічого не робити поки що
mkdir -p ~/.local/share/fonts cd /tmp wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip unzip JetBrainsMono.zip -d ~/.local/share/fonts/JetBrainsMono && rm JetBrainsMono.zip fc-cache -fv
Перевірка:
fc-list | grep -i "JetBrainsMono"
brew install font-jetbrains-mono-nerd-font
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
і перемкнутися на zsh (якщо цього не сталося автоматично):
zsh
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \
${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
завантажити конфіг Powerlevel 10k config та зберегти в домашньому каталозі:
mv p10k_zsh ~/.p10k.zsh
Тепер додати в кінець .zshrc:
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
А на самий початок ~/.zshrc додати:
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
додамо корисні плагіни zsh-autosuggestions zsh-syntax-highlighting
brew install zsh-autosuggestions zsh-syntax-highlighting mkdir -pv ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/{zsh-autosuggestions,zsh-syntax-highlighting} ln -s $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh ln -s $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
можливо, щось аналогічне треба зробити й для Лінукс
відкрити ~/.zshrc
plugins=( git terraform direnv z zsh-autosuggestions zsh-syntax-highlighting )
можна додати й інші плагіни, але обережно, це гальмує запуск терміналу
Щоб додати аліаси та інше, треба створити файл ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/my-aliases.zsh (ім'я на свій смак) і в нього додати:
### Aliases
alias ls="/bin/ls --color=never -F --group-directories-first"
alias dir="ls -a"
alias l="ls -la"
alias ді=ls
alias св=cd
alias cw="clear; w"
alias x="exit"
alias cls="clear"
alias bc="bc -ql"
alias tt=traceroute
alias ports="sudo netstat -luntp"
alias monitor_turn_off="xset dpms force off"
alias chromium="/usr/bin/chromium-browser >/dev/null 2>&1 &"
# Find top 5 big files
alias findbig="find . -type f -exec ls -s {} \; | sort -n -r | head -5"
# To clear all the history and screen
alias hcl='history -c; clear'
# Make basic commands verbose
alias cp="cp -v"
alias rm="rm -v"
alias mv="mv -v"
# To navigate to the different directories
alias ..='cd ..'
alias ...='cd ../..'
# display currently mounted file systems nicely
showmounted() { (echo "DEVICE PATH TYPE FLAGS" && mount | awk '$2=$4="";1') | column -t; }
# EXTENDED
alias myip='curl https://ipv4.icanhazip.com'
alias zimdate="LC_TIME=en_US.UTF-8 date '+Week %V%n%A, %d.%m.%Y'"
# List processes grouped by cgroups
alias psc='ps xawf -eo pid,user,cgroup,args'
# Recursively show control group contents
alias pss="systemd-cgls"
alias gfo="git fetch origin && git status"
alias list_instances="aws ec2 describe-instances --no-cli-pager --color off --filter Name=tag-key,Values=Name Name=instance-state-name,Values=running --query 'Reservations[*].Instances[*].{Instance_Id:InstanceId,Type:InstanceType,Public_IP:PublicIpAddress,Private_IP:PrivateIpAddress,SSH_Key:KeyName,Name:Tags[?Key==\`Name\`]|[0].Value}' --output table"
alias apg1="apg -a 0 -n 1 -m 8 -x 10 -M NCL -E I1l0O"
alias apg2="apg -a 0 -n 1 -m 14 -x 16 -M NCL -E I1l0O"
alias apg3="apg -a 0 -n 1 -m 14 -x 16 -M NCLS -E I1l0O"
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="ssh -D 8888 nephalia"
alias proxy_vps="ssh -D 8888 hastur"
[ -f /usr/bin/batcat ] && alias bat="/usr/bin/batcat"
alias cal="ncal -w"
alias play_sound="aplay ~/Music/effects/Train\ Fx\ 2.wav"
alias va='source ./.venv/bin/activate'
alias ve='python3 -m venv ./.venv'
alias tree='tree -C --dirsfirst'
alias show_flac_bitrate="metaflac --show-bps --show-sample-rate"
alias veracrypt_mount="veracrypt --slot=2 --mount /dev/sdb2 ~/vera/"
alias veracrypt_umount="veracrypt --slot=2 --unmount ~/vera/"
alias typora="flatpak run io.typora.Typora"
# update packages
if [[ -f /etc/os-release ]]; then
if grep -q "^ID=ubuntu$" /etc/os-release; then
# alias update="sudo snap refresh; sudo apt update && sudo apt upgrade; sudo flatpak update"
alias update="$HOME/scripts/update.sh"
alias update_small="sudo apt upgrade --assume-yes"
alias update_download_only="sudo apt update && sudo apt upgrade --download-only --assume-yes"
elif grep -q "^ID=debian$" /etc/os-release; then
alias update="sudo apt update && sudo apt upgrade --assume-yes"
alias update_download_only="sudo apt update && sudo apt upgrade --download-only --assume-yes"
fi
fi
# Zsh-specific aliases
alias icat='wezterm imgcat --width 100%'
# preview all images in current directory
icatdir() {
for img in *.{png,jpg,jpeg,gif,webp,bmp}(N); do
echo "--- $img ---"
wezterm imgcat "$img"
done
}
# Zsh-specific suffix aliases
alias -s png="wezterm imgcat"
alias -s jpg="wezterm imgcat"
alias -s jpeg="wezterm imgcat"
alias -s gif="wezterm imgcat"
alias -s bmp="wezterm imgcat"
alias -s webp="wezterm imgcat"
alias -s ico="wezterm imgcat"
alias -s md="flatpak run io.typora.Typora"
#alias -s epub='ebook-viewer'
alias -s mobi='ebook-viewer'
alias -s azw3='ebook-viewer' # Kindle format
alias -s fb2='ebook-viewer' # popular in UA/RU
alias -s djvu='ebook-viewer' # scanned books, scientific papers
alias -s cbz='ebook-viewer' # comics
alias -s cbr='ebook-voiewer' # comics (rar-based)
alias -s js='code'
alias -s yaml='code'
alias -s yml='code'
alias -s toml='code'
# open pdf in okular (default KDE viewer) instead of calibre
alias -s pdf='okular'
# Calibre Viewer
_ebook_open() {
ebook-viewer "$1" &
local viewer_pid=$! # get PID of background process
# wait for window with this PID to appear (max 10 seconds)
local timeout=10
local waited=0
until wmctrl -lp | awk '{print $3}' | grep -q "^${viewer_pid}$" || (( waited >= timeout )); do
sleep 0.3
(( waited++ ))
done
~/scripts/align-window.sh center 40 "pid:${viewer_pid}"
}
alias -s epub='_ebook_open'
### Functions
# Create and change to a new directory
mcd ()
{
if [ "$1" == "" ]; then
echo "mcd directory-name";
else
if [ ! -d $1 ]; then
mkdir $1;
cd $1;
else
echo "$1 directory exists";
fi;
fi
}
* WezTerm official site