unzip의 사전설치가 필요.
sudo apt install unzip으로 설치
# admin 권한필요
curl -s https://ohmyposh.dev/install.sh | bash -s
# 위에 방법이 실패하면 사용자계정아래 설치하는 다음 문구로 설치
curl -s https://ohmyposh.dev/install.sh | bash -s -- -d ~/bin
설치하여 아래처럼 안내문구 보이면
theme를 설정하고 bashrc에 관련 항목을 적어줘야 함.
ubuntu@ubunt:~$ curl -s https://ohmyposh.dev/install.sh | bash -s -- -d ~/bin
⚠️ Installation directory /home/ubuntu/bin is not in your $PATH
ℹ️ Installing oh-my-posh for linux-amd64 in /home/ubuntu/bin
⬇️ Downloading oh-my-posh from https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64
🎨 Installing oh-my-posh themes in /home/ubuntu/.cache/oh-my-posh/themes
🚀 Installation complete.
You can follow the instructions at https://ohmyposh.dev/docs/installation/prompt
to setup your shell to use oh-my-posh.
If you want to use a built-in theme, you can find them in the directory:
oh-my-posh init {shell} --config /{theme}.omp.json
터미널을 다시 시작하거나 source ~/.bashrc 로 재설정하면 사용가능
# open editor
sudo nano ~/.bashrc
# paste below at the bottom line
if [ -d "$HOME/bin" ] ; then
PATH="$PATH:$HOME/bin"
fi
별도 명령어 없이 간단히 font 설치가능. 아래 명령어로
oh-my-posh font install
------------------------
Successfully installed D2Coding 🚀
The following font families are now available for configuration:
• D2CodingLigature Nerd Font Mono
• D2CodingLigature Nerd Font Propo
• D2CodingLigature Nerd Font
# FONT 수동설치
sudo apt install wget fontconfig
# install d2coding font
wget -P ~/.local/share/fonts https://github.com/ryanoasis/nerd-fonts/releases/latest/download/D2Coding.zip \
&& cd ~/.local/share/fonts && unzip D2Coding.zip && rm D2Coding.zip
fc-cache -f -v
fc-list | grep -i d2coding
# install Hack font
wget -P ~/.local/share/fonts https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Hack.zip \
&& cd ~/.local/share/fonts && unzip Hack.zip && rm Hack.zip
fc-cache -f -v
fc-list | grep -i hack
https://thekkom.tistory.com/15
THEME change prompt
## Install Oh my Posh
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
sudo chmod +x /usr/local/bin/oh-my-posh
## Download the themes
mkdir ~/.poshthemes
wget 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
# add ~/.bashrc
sudo nano ~/.bashrc
# add at the bottom
eval "$(oh-my-posh init bash --config ~/.poshthemes/{theme}.omp.json)"
# run
source ~/.bashrc
--------------------
# select THEME
eval "$(oh-my-posh init bash --config ~/.poshthemes/jandedobbeleer.omp.json)"
eval "$(oh-my-posh init bash --config ~/.poshthemes/powerlevel10k_lean.omp.json)"
eval "$(oh-my-posh init bash --config ~/.poshthemes/cobalt2.omp.json)"
eval "$(oh-my-posh init bash --config ~/.poshthemes/powerline.omp.json)"
문제)
** vscode.dev으로 접속해 terminal의 font를 설정해도 nerd font의 특수문자/심볼이 표시가 정상적으로 안됨
Reference
https://thekkom.tistory.com/285
https://calebschoepp.com/blog/2021/how-to-setup-oh-my-posh-on-ubuntu/
아래에서는 위와 다르게, poshthemes json파일을 ~/.poshthemes로 설정함. 위와 다름
## Install Oh my Posh
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
sudo chmod +x /usr/local/bin/oh-my-posh
## Download the themes
mkdir ~/.poshthemes
wget 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
_
반응형