2020/01/06 補充:呃,我把它升級 (?) 到 Powerlevel10k 了,Powerlevel10k 建議的字型也不錯看,只是大部份的 icon 都變小了... :(
這兩天把個人在使用的終端機環境改造了一番,很能自嗨,所以留個記錄... XD
- 先裝 Homebrew
- 再安裝 caskroom
brew update
brew install cask
- 參考這裡完成 zsh / oh-my-zsh 的安裝
- 安裝 Powerlevel9k
- 安裝相關字型
- 編輯 ~/.zshrc ,設定 Powerlevel9k 運作模式
# 找到 ZSH_THEME 字串位置,改成如下:
POWERLEVEL9K_MODE=nerdfont-complete
ZSH_THEME="powerlevel9k/powerlevel9k"
- 參考作者的說明及別人的設定,組合出自己最酷炫的終端機界面,重點可先放在以下幾項測試:
- POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
- POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS
- POWERLEVEL9K_PROMPT_ADD_NEWLINE
- POWERLEVEL9K_PROMPT_ON_NEWLINE
- 個人的設定如下,加在 ~/.zshrc 檔案末端:
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
POWERLEVEL9K_TIME_BACKGROUND="white"
POWERLEVEL9K_TIME_FOREGROUND="black"
# POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S}"
POWERLEVEL9K_VCS_GIT_ICON='\uf1d3'
POWERLEVEL9K_VCS_GIT_GITHUB_ICON='\uf09b'
# POWERLEVEL9K_VCS_CLEAN_FOREGROUND='blue'
# POWERLEVEL9K_VCS_CLEAN_BACKGROUND='black'
# POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND='red'
# POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='black'
# POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='black'
# POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='black'
POWERLEVEL9K_STATUS_VERBOSE=true
POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE=false
POWERLEVEL9K_VPN_ICON='\uf023'
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_FOLDER_ICON='\uf114'
# Bateria
POWERLEVEL9K_BATTERY_CHARGING='yellow'
POWERLEVEL9K_BATTERY_CHARGED='blue'
POWERLEVEL9K_BATTERY_LOW_THRESHOLD='20'
POWERLEVEL9K_BATTERY_LOW_COLOR='red'
POWERLEVEL9K_BATTERY_CHARGED_BACKGROUND='46'
POWERLEVEL9K_BATTERY_CHARGED_FOREGROUND='235'
POWERLEVEL9K_BATTERY_CHARGING_BACKGROUND='178'
POWERLEVEL9K_BATTERY_CHARGING_FOREGROUND='235'
POWERLEVEL9K_BATTERY_LOW_BACKGROUND='88'
POWERLEVEL9K_BATTERY_LOW_FOREGROUND='235'
POWERLEVEL9K_BATTERY_CHARGED_ICON='\UF240'
POWERLEVEL9K_BATTERY_LOW_ICON='\UF240'
POWERLEVEL9K_BATTERY_CHARGING_ICON='\UF1E6'
POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND='white'
POWERLEVEL9K_BATTERY_DISCONNECTED_BACKGROUND='red'
POWERLEVEL9K_BATTERY_ICON='\UF1E6'
# Anaconda
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(anaconda battery)
POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER='>'
POWERLEVEL9K_ANACONDA_LEFT_DELIMITER='<'
POWERLEVEL9K_ANACONDA_BACKGROUND='24'
POWERLEVEL9K_ANACONDA_FOREGROUND='111'
# POWERLEVEL9K_ANACONDA_ICON=''
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir dir_writable vcs )
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs command_execution_time time battery anaconda)
- 記得在終端機中選定使用的字型為剛剛安裝的 Nerd 字型,不然只會看到亂碼 1/2 ... (這哏好冷)
- 效果如下,謝謝收看!