변군이글루 블로그(Development)
원도우 11에 Oh My Posh를 설치하고 테마를 적용하는 방법 본문
728x90
원도우 11에 Oh My Posh를 설치하고 테마를 적용하는 방법
PowerShell 프롬프트를 열고 다음 명령을 실행합니다.
winget install oh-my-posh
winget install XP8K0HKJFRXGCK
winget install JanDeDobbeleer.OhMyPosh -s winget
winget upgrade JanDeDobbeleer.OhMyPosh -s winget
테마 파일 생성
echo $HOME
> echo $HOME
C:\Users\Administrator
vscode 사용하여 .mytheme.omp.json 파일을 편집합니다.
code .mytheme.omp.json
.mytheme.omp.json 파일 내용 보기
더보기
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 2,
"final_space": true,
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "session",
"style": "diamond",
"foreground": "#ffffff",
"background": "#9A348E",
"leading_diamond": "\ue0b6",
"template": "{{ .UserName }} "
},
{
"type": "path",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "#ffffff",
"background": "#DA627D",
"template": " {{ .Path }} ",
"properties": {
"style": "folder"
}
},
{
"type": "git",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "#ffffff",
"background": "#FCA17D",
"template": " ➜ ({{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }}) ",
"properties": {
"branch_icon": "",
"fetch_stash_count": true,
"fetch_status": false,
"fetch_upstream_icon": true
}
},
{
"type": "node",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "#ffffff",
"background": "#86BBD8",
"template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} "
},
{
"type": "time",
"style": "diamond",
"foreground": "#ffffff",
"background": "#33658A",
"trailing_diamond": "\ue0b0",
"template": " ♥ {{ .CurrentDate | date .Format }} ",
"properties": {
"time_format": "15:04"
}
}
]
}
]
}
메모장을 사용하여 profile 파일을 편집합니다.
notepad $PROFILE
oh-my-posh init pwsh --config "$HOME/.mytheme.omp.json" | Invoke-Expression
oh-my-posh --init --shell pwsh --config $HOME/.mytheme.omp.json | Invoke-Expression
참고URL
- Oh My Posh : https://ohmyposh.dev/docs/installation/windows
- Oh My Posh 설치 : https://ddochea.tistory.com/190
- Nerd Fonts 다운로드 : https://www.nerdfonts.com/font-downloads
- 프로그램 글꼴 : https://www.programmingfonts.org/#nanum-gothic-coding
- Oh My Posh를 사용하여 PowerShell 또는 WSL에 대한 사용자 지정 프롬프트 설정
728x90
'원도우' 카테고리의 다른 글
도커 이미지를 빌드하고 푸시하는 방법 (0) | 2023.07.05 |
---|---|
원도우 11에서 글꼴을 설치하는 방법 (0) | 2023.06.30 |
PowerShell에서 스크립트 실행 정책이 제한되어 있는 경우 발생하는 오류 (0) | 2023.06.30 |
[draft] 원도우 BLUEMAX CLIENT 삭제하는 방법 (0) | 2023.06.23 |
원도우 검색 상자 숨기기 및 숨기기 취소 (0) | 2023.06.21 |