Fork me on GitHub

terminal 终端美化

编辑 PowerShell 配置文件脚本,每次启动之后自动加载

notepad $PROFILE

在配置文件里添加以下行:

oh-my-posh init pwsh --config '$env:POSH_THEMES_PATH\jandedobbeleer.omp.json' | Invoke-Expression

ubuntu 在.bash_profile文件里

eval "$(oh-my-posh init bash --config '~/.cache/oh-my-posh/themes/aliens.omp.json')"

重新加载配置文件以使更改生效

. $PROFILE

查看所有themes:

Get-PohshThemes

设置选中的themes:

oh-my-posh init pwsh --config 'C:\Users\Lenovo\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json' | Invoke-Expression

设置随机themes:

$theme = Get-ChildItem $env:UserProfile\\AppData\\Local\\Programs\\oh-my-posh\\themes\\ | Get-Random
echo "hello! today's lucky theme is: $theme :)"
oh-my-posh --init --shell pwsh --config $theme.FullName | Invoke-Expression

参考链接:
Themes | Oh My Posh
PowerShell | Oh-My-Posh|
ubuntu 安装看这个 | oh-my-posh

posted @   Cloudhan  阅读(68)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示