rkttu
June 15, 2023, 7:26am
1
미처 몰랐는데, oh-my-posh로 Win32 cmd (!), PowerShell, bash, zsh까지 한 번에 같은 스타일로 적용하는 것이 가능해서, 간단한 초기화 스크립트들을 만들어보았습니다.
다만 Win32 cmd는 태생적 한계로 인해서 부가 기능을 편하게 얹을 수는 없고, Clink라는 확장 툴을 이용해서 기반을 만들어 놓고 그 위에 oh-my-posh를 덧붙이는 형태입니다. 그렇지만 Clink도 winget으로 쉽게 설치가 가능하니 적용이 어렵지는 않습니다!
.bashrc
# for bash (macOS)
POSH_THEMES_PATH=$(brew --prefix oh-my-posh)/themes
eval "$(oh-my-posh completion bash)"
eval "$(oh-my-posh init bash --config "$POSH_THEMES_PATH"/clean-detailed.omp.json | sed 's|\[\[ -v MC_SID \]\]|[[ -n "$MC_SID" ]]|')"
.profile
# for bash (Ubuntu, WSL)
# # Download the themes before getting started.
# sudo apt install curl unzip
# mkdir ~/.poshthemes
# curl -L https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -o ~/.poshthemes/themes.zip
# unzip ~/.poshthemes/themes.zip -d ~/.poshthemes
# chmod u+rw ~/.poshthemes/*.json
# rm ~/.poshthemes/themes.zip
This file has been truncated. show original
.zshrc
# for zsh
autoload -Uz compinit
compinit
POSH_THEMES_PATH=$(brew --prefix oh-my-posh)/themes
eval "$(oh-my-posh completion zsh)"
eval "$(oh-my-posh init zsh --config "$POSH_THEMES_PATH"/clean-detailed.omp.json)"
There are more than three files. show original
3 Likes