打造属于你的二次元终端!

801 阅读1分钟

前言

作为一个前端小萌新,无意中在某音冲浪时看到一个"炫酷"的终端界面,日思夜想的我想要一个“二次元风”终端,这里浅浅记录一下自己终端的改造过程,由于我是window10的用户,所以这里通过Windows Terminal终端来进行oh-my-posh主题的安装

什么是 Oh My Posh?

官网的原话是这样说的: Oh My Posh is a custom prompt engine for any shell that has the ability to adjust the prompt string with a function or variable. 点击前往官网

说白了,它就是一个全平台终端提示符个性化工具,既可以让你手动DIY也可以使用现成的主题方案,这里主要使用现成的主题方案。

最终效果图预览

image.png

image.png

1.Windows Terminal

打开你的Microsoft Store
搜索 Windows Terminal 并下载安装(如图所示)

Windows Terminal.png

2.改造你的终端第一弹!安装nerd字体

这里使用的是FiraCodeNerdFontMono-Regular字体,附上这款字体的下载链接
pan.baidu.com/s/1-5C5u0JC… 提取码:tf0t,下载安装即可

3.改造背景及字体

同时按住win+r,输入WT并回车,按如下步骤操作

(注意:如果没有安装nerd字体将导致使用的主题方案无法完全显示)

image.png image.png

定位到profiles如何输入如图所示代码

backgroundImage替换成自己本机的图片即可

image.png

4.安装oh-my-posh

使用如下命令在windows terminal中安装

winget install JanDeDobbeleer.OhMyPosh -s winget

5.oh-my-posh配置

新建配置文件 New-Item -Path $PROFILE -Type File -Force
打开配置文件 notepad $PROFILE

写入如下主题配置代码:

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

这里可替换成自己喜欢的主题,只需要将montys.omp.json中的montys修改即可

6.oh-my-posh其他配置项

查看所有可获取主题

Get-poshThemes

image.png