當(dāng)前位置:首頁 > IT技術(shù) > Windows編程 > 正文

Windows Terminal 美化教程
2021-09-08 11:50:13

Windows Terminal 美化教程

1.安裝Windows Terminal

在微軟商店搜索Windows Terminal下載即可

2.安裝相應(yīng)的插件

使用管理員權(quán)限打開Windows Terminal并運(yùn)行

Install-Module posh-git
Install-Module oh-my-posh

使用主題

Set-PoshPrompt -Theme blueish

許多教程里是

Set-Theme blueish

這是在oh-my-posh舊版的命令

3.安裝字體

oh-my-posh中會使用一些特殊符號,使用主題時終端出現(xiàn)方框,因此采用推薦的Meslo字體,下載安裝包后解壓放置在C:/Windows/Fonts中即可完成安裝。

4.配置主題

Set-PoshPrompt -Theme blueish

該命令只對當(dāng)前終端有效,終端重新打開后會失效

code $PROFILE

該命令是編輯powershell配置文件命令

打開文件后編輯內(nèi)容后保存:

Import-Module posh-git 
Import-Module oh-my-posh 
Set-PoshPrompt -Theme blueish

這樣每次打開Windows Terminal都會將主題設(shè)置一次

5.自定義

配置Windows Terminal

打開JSON配置文件:

修改profiles-list該配置項為下拉框中每個選項的詳細(xì)配置,給powershell添加以下配置:

"backgroundImage" : "D://Data//Files//圖片//壁紙//row//wallhaven-9mogy1.jpg", // 背景圖片地址
"backgroundImageOpacity" : 0.8,  //透明度
"backgroundImageStretchMode": "uniformToFill", // 圖片伸縮模式:設(shè)置伸縮模式成按比例放大
"backgroundImageOpacity" : 0.2,  //透明度
"acrylicOpacity" : 0.5, //  定義亞克力效果的透明度
"useAcrylic": true, // 毛玻璃效果
"background" : "#242425",  // 背景顏色
"fontFace":"MesloLGM NF", // 字體
"fontSize": 10, // 字體大小
"padding": "5, 5, 20, 25",
"colorScheme": "Cobalt Neon" // 顏色方案

可以在default中添加部分設(shè)置,讓每個終端界面都使用主題。

colorScheme對應(yīng)的配色方案設(shè)置在schemes

{
                "name": "Cobalt Neon",
                "black": "#142631",
                "red": "#ff2320",
                "green": "#3ba5ff",
                "yellow": "#e9e75c",
                "blue": "#8ff586",
                "purple": "#781aa0",
                "cyan": "#8ff586",
                "white": "#ba46b2",
                "brightBlack": "#fff688",
                "brightRed": "#d4312e",
                "brightGreen": "#8ff586",
                "brightYellow": "#e9f06d",
                "brightBlue": "#3c7dd2",
                "brightPurple": "#8230a7",
                "brightCyan": "#6cbc67",
                "brightWhite": "#8ff586",
                "background": "#142838",
                "foreground": "#8ff586",
                "selectionBackground": "#094fb1",
                "cursorColor": "#c4206f"
}

最終效果:

本文摘自 :https://www.cnblogs.com/

開通會員,享受整站包年服務(wù)立即開通 >