ubuntu:: install oh-my-posh

 
 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

 

ubuntu:: install d2coding font in jupyter, docker

2022-08-24 update Ubuntu(Linux)환경에서 Jupyter Notebook이나 Code-server를 사용하다보면 한글폰트가 필요할 때가 있다.시놀로지 - Docker내 환경이라 하더라도 리눅스 기반의 Docker실행이다 보니 Ubuntu(Linux) 환

thekkom.tistory.com

 

 

 


 

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

 

windows:: install oh-my-posh 윈도우 // customize windows terminal

https://learn.microsoft.com/en-us/windows/terminal/tutorials/custom-prompt-setup#customize-your-wsl-prompt-with-oh-my-posh Windows Terminal Custom Prompt SetupIn this tutorial, you learn how to set up Oh My Posh and Terminal-Icons in Windows Terminal.lear

thekkom.tistory.com

 

 

 

 

https://calebschoepp.com/blog/2021/how-to-setup-oh-my-posh-on-ubuntu/

 

How to Setup Oh my Posh On Ubuntu - Caleb Schoepp

While onboarding at my latest internship I noticed that my manager had a very aesthetically pleasing shell. Upon further inspection I discovered he was using something called Oh my Posh. It markets itself as, “A prompt theme engine for any shell.” It

calebschoepp.com

 

아래에서는 위와 다르게, 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


 
 

 

 

 


_

반응형