vault backup: 2025-07-22 22:14:08
Affected files: Too many files to list
This commit is contained in:
39
21.01. OS/21.02. Windows/Msys2.md
Normal file
39
21.01. OS/21.02. Windows/Msys2.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
tags:
|
||||
aliases:
|
||||
date: 2025-05-05
|
||||
time: 10:08:21
|
||||
description:
|
||||
---
|
||||
|
||||
# Install Msys2
|
||||
根據[MSYS2](https://www.msys2.org/)官方頁面來下載並安裝最新的版本。
|
||||
基本上都只要下一步即可。
|
||||
|
||||
## 設定 `MSYS2_HOME` 環境變數
|
||||
把 Msys2 的 安裝路徑設為環境變數可以讓以後的設定更有彈性。如下:
|
||||
![[20250505_101259_SystemPropertiesAdvanced_839x208.png]]
|
||||
|
||||
## 設定 `path` 環境變數
|
||||
在 `path` 環境變數中新增 Msys2 的 bin 路徑,如下:
|
||||
![[20250505_101427_SystemPropertiesAdvanced_677x633.png]]
|
||||
|
||||
# 用 Msys2 安裝開發工具
|
||||
根據[Environments - MSYS2](https://www.msys2.org/docs/environments/#__tabbed_1_1),Msys2 提供多種開發環境。我們使用 UCRT64。
|
||||
![[20250505_101709_chrome_844x478.png]]
|
||||
|
||||
## 安裝 UCRT64 開發環境
|
||||
打開 UCRT64 terminal
|
||||
![[20250505_101809_Obsidian_267x313.png]]
|
||||
然後輸入`pacman -Syy --needed base-devel mingw-w64-ucrt-x86_64-toolchain`,之後都輸入`Y`來接受所有安裝。
|
||||
|
||||
# 用 Msys2 安裝工具
|
||||
用 `pacman -Syy <TOOL_NAME>` 就可以安裝工具,例如:
|
||||
```shell
|
||||
pacman -Syy zsh git
|
||||
```
|
||||
|
||||
# 參考來源
|
||||
- [Windows 命令行相关配置之 msys2+zsh+zi](https://sansui233.github.io/posts/windows-zsh-conf)
|
||||
- [在Windows上使用Fish替换cmd在日常开发过程中,我们也需要常常和命令行打交道,而Windows自带的cmd或者 - 掘金](https://juejin.cn/post/7362743871979749391)
|
||||
- [Msys2+VSCode配置Windows下C或C++环境在使用Windows开发C或者C++项目时,大多数人通常会选择 - 掘金](https://juejin.cn/post/7369903157646229556)
|
||||
132
21.01. OS/21.02. Windows/Windows 11 重灌.md
Normal file
132
21.01. OS/21.02. Windows/Windows 11 重灌.md
Normal file
@@ -0,0 +1,132 @@
|
||||
# 要保存/恢復的檔案
|
||||
- `%userprofile%/.config`
|
||||
- `%userprofile%/.ssh`
|
||||
- `%userprofile%/.bash_profile`
|
||||
- `%userprofile%/.bashrc`
|
||||
- `%userprofile%/.zshrc`
|
||||
- `%userprofile%/.gitconfig`
|
||||
- `%userprofile%/.vimrc`
|
||||
|
||||
# 安裝工具
|
||||
## 使用 [WinGet](https://learn.microsoft.com/zh-tw/windows/package-manager/winget/) 安裝工具
|
||||
```bash
|
||||
winget install \
|
||||
Microsoft.PowerToys \
|
||||
7zip.7zip \
|
||||
MHNexus.HxD \
|
||||
SublimeHQ.SublimeText.4 \
|
||||
Git.Git \
|
||||
dandavison.delta \
|
||||
WinMerge.WinMerge \
|
||||
SoftDeluxe.FreeDownloadManager \
|
||||
Google.Chrome \
|
||||
CodecGuide.K-LiteCodecPack.Mega \
|
||||
Win32diskimager.win32diskimager \
|
||||
Google.GoogleDrive \
|
||||
Microsoft.VisualStudioCode \
|
||||
Google.AndroidStudio \
|
||||
Microsoft.PowerShell
|
||||
```
|
||||
|
||||
```PowerShell
|
||||
winget install `
|
||||
Microsoft.PowerToys `
|
||||
7zip.7zip `
|
||||
MHNexus.HxD `
|
||||
SublimeHQ.SublimeText.4 `
|
||||
Git.Git `
|
||||
dandavison.delta `
|
||||
WinMerge.WinMerge `
|
||||
SoftDeluxe.FreeDownloadManager `
|
||||
Google.Chrome `
|
||||
CodecGuide.K-LiteCodecPack.Mega `
|
||||
Win32diskimager.win32diskimager `
|
||||
Google.GoogleDrive `
|
||||
Microsoft.VisualStudioCode `
|
||||
Google.AndroidStudio \
|
||||
Microsoft.PowerShell
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 安裝 Chocolatey
|
||||
安裝[Chocolatey](https://chocolatey.org/),用Administrator身份打開powershell,輸入下列指令:
|
||||
```
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||
```
|
||||
|
||||
## 用 Chocolatey 安裝工具
|
||||
```
|
||||
choco install powertoys 7zip vscode hxd sublimetext4 androidstudio intellijidea-community git winmerge freefilesync freedownloadmanager gsudo firacode cascadiacode sourcecodepro delta googlechrome googledrive enpass.install sharex win32diskimager k-litecodecpackmega obsidian anki enpass.install --yes
|
||||
```
|
||||
|
||||
可以在 [https://community.chocolatey.org/packages](https://community.chocolatey.org/packages) 找到其他工具,再加到清單後面即可。
|
||||
|
||||
上面的指令安裝了下列的軟體,可以依自己需求增刪:
|
||||
- [powertoys](https://community.chocolatey.org/packages/powertoys)
|
||||
- [7zip](https://community.chocolatey.org/packages/7zip)
|
||||
- [vscode](https://community.chocolatey.org/packages/vscode)
|
||||
- [hxd](https://community.chocolatey.org/packages/hxd)
|
||||
- [sublimetext4](https://community.chocolatey.org/packages/sublimetext4)
|
||||
- [androidstudio](https://community.chocolatey.org/packages/androidstudio)
|
||||
- [intellijidea-community](https://community.chocolatey.org/packages/intellijidea-community)
|
||||
- [git](https://community.chocolatey.org/packages/git)
|
||||
- [winmerge](https://community.chocolatey.org/packages/winmerge)
|
||||
- [freefilesync](https://community.chocolatey.org/packages/freefilesync)
|
||||
- [freedownloadmanager](https://community.chocolatey.org/packages/freedownloadmanager)
|
||||
- [gsudo](https://community.chocolatey.org/packages/gsudo)
|
||||
- [firacode](https://community.chocolatey.org/packages/firacode)
|
||||
- [cascadiacode](https://community.chocolatey.org/packages/cascadiacode)
|
||||
- [sourcecodepro](https://community.chocolatey.org/packages/sourcecodepro)
|
||||
- [delta](https://community.chocolatey.org/packages/delta)
|
||||
- [googlechrome](https://community.chocolatey.org/packages/googlechrome)
|
||||
- [googledrive](https://community.chocolatey.org/packages/googledrive)
|
||||
- [enpass.install](https://community.chocolatey.org/packages/enpass.install)
|
||||
- [sharex](https://community.chocolatey.org/packages/sharex)
|
||||
- [win32diskimager](https://community.chocolatey.org/packages/win32diskimager)
|
||||
- [k-litecodecpackmega](https://community.chocolatey.org/packages/k-litecodecpackmega)
|
||||
- [obsidian](https://community.chocolatey.org/packages/obsidian)
|
||||
- [anki](https://community.chocolatey.org/packages/anki)
|
||||
- [Enpass Password Manager](https://community.chocolatey.org/packages/enpass.install)
|
||||
|
||||
## 用 Chocolatey 升級軟體
|
||||
|
||||
```shell
|
||||
choco upgrade all -y
|
||||
```
|
||||
|
||||
# 手動安裝
|
||||
3. Python 3.6.3
|
||||
4. Python 3.9
|
||||
7. Visual Studio 2022
|
||||
8. Office 365
|
||||
9. [Sublime Text 4](https://www.sublimetext.com/download)
|
||||
10. Lightroom
|
||||
11. [卡巴斯基](https://www.kaspersky.com.tw/)
|
||||
12. 字型
|
||||
- [Caskaydia](\\diskstation\share\Tools\字型\Caskaydia Cove Nerd Font\)
|
||||
13. 安裝 [`wget`](https://eternallybored.org/misc/wget/)
|
||||
1. [Version 1.21.4](https://eternallybored.org/misc/wget/1.21.4/64/wget.exe)
|
||||
|
||||
# `~/.bashrc`
|
||||
1. 打開`~/.bashrc`。
|
||||
2. 內容如[[bashrc|bashrc]]
|
||||
|
||||
# Setup Windows Terminal
|
||||
1. 開啟Windows Terminal。
|
||||
2. 按`ctrl + ,`打開設定,之後參考[[Windows Terminal]]。
|
||||
|
||||
# 恢復右鍵選單
|
||||
- 以admin身份打開PowerShell,執行 `reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve`
|
||||
- 要恢復Windows 11的右鍵選單則是執行:`reg delete "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" /f`
|
||||
|
||||
# 設定使用者環境變數
|
||||
- `PYTHON_INCLUDE`: `C:\Python363\include`
|
||||
- `PYTHON_LIB`: `C:\Python363\libs`
|
||||
- `RobotRunCommonLib`: `C:\SynologyDrive\codes\CommonLib\RobotRunCommonLib`
|
||||
- `SWIGCmd`: `C:\SynologyDrive\PortableApps\swigwin-4.3.0\swig.exe`
|
||||
- `SYNODRIVE_PATH`: `C:\SynologyDrive`
|
||||
|
||||
# 參考
|
||||
- [How to open the full right-click menu by default on Windows 11](https://www.xda-developers.com/how-to-open-full-right-click-menu-by-default-windows-11/)
|
||||
- [【教學】Windows 11 系統優化](https://ofeyhong.pixnet.net/blog/post/225581177)
|
||||
25
21.01. OS/21.02. Windows/_Map.canvas
Normal file
25
21.01. OS/21.02. Windows/_Map.canvas
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"nodes":[
|
||||
{"id":"e724a0b36766d3a9","type":"group","x":440,"y":-480,"width":475,"height":880,"label":"應該是可用的流程"},
|
||||
{"id":"0138bfb5c46d71f1","type":"text","text":"1. 用[[powercfg powerthrottling]]關閉 VirtualBox power throttling。","x":-149,"y":-191,"width":329,"height":91},
|
||||
{"id":"d34f3157e07cb50d","type":"text","text":"開始","x":-200,"y":40,"width":100,"height":50,"color":"2"},
|
||||
{"id":"c276871e8748cbfe","type":"text","text":"[PowerWriteDCValueIndex](https://learn.microsoft.com/zh-tw/windows/win32/api/powersetting/nf-powersetting-powerwritedcvalueindex)\n```c\nPowerWriteDCValueIndex(NULL, scheme,\n &GUID_PROCESSOR_SETTINGS_SUBGROUP, \n &GUID_PROCESSOR_THROTTLE_MAXIMUM, percent);\n```","x":460,"y":-88,"width":429,"height":149},
|
||||
{"id":"b89cd7d463506018","type":"text","text":"[PowerSetActiveScheme](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/nf-powersetting-powersetactivescheme)","x":549,"y":100,"width":252,"height":60},
|
||||
{"id":"dd89a32995de8e4a","type":"text","text":"# 參考\n- [Tweak CPU Power Elegantly on Windows - kkocdko's blog](https://kkocdko.site/post/202110041950)\n- [Powersetting.h header - Win32 apps | Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/)","x":460,"y":200,"width":435,"height":180},
|
||||
{"id":"154d88218d26f035","type":"text","text":"[PowerWriteACValueIndex](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/nf-powersetting-powerwriteacvalueindex)\n```c\nPowerWriteACValueIndex(NULL, scheme, \n &GUID_PROCESSOR_SETTINGS_SUBGROUP,\n &GUID_PROCESSOR_THROTTLE_MAXIMUM, percent);\n```","x":460,"y":-255,"width":429,"height":151},
|
||||
{"id":"bb0881e617ca2f52","type":"text","text":"[PowerGetActiveScheme](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/nf-powersetting-powergetactivescheme)\n```c\nGUID guid, *scheme = &guid; PowerGetActiveScheme(NULL, &scheme);\n```","x":502,"y":-460,"width":346,"height":125},
|
||||
{"id":"1b7a2018be9a2542","type":"text","text":"- [[設定CPU Power mode]]","x":80,"y":35,"width":250,"height":60},
|
||||
{"id":"034536d7a91d7b62","x":-100,"y":320,"width":133,"height":60,"type":"text","text":"工具設定"},
|
||||
{"id":"197b4dc40754a989","x":-201,"y":460,"width":335,"height":211,"type":"text","text":"- [[Chrome]]\n- [[freefilesync]]\n- [[Obsidian 操作]]\n- [[SublimeText]]\n- [[vim]]\n- [[Visual Studio Code]]\n- [[Windows 11 重灌]]\n- [[Windows Terminal]]"}
|
||||
],
|
||||
"edges":[
|
||||
{"id":"5c4879a42c2db8ac","fromNode":"d34f3157e07cb50d","fromSide":"top","toNode":"0138bfb5c46d71f1","toSide":"bottom"},
|
||||
{"id":"631e78e7dee93490","fromNode":"d34f3157e07cb50d","fromSide":"right","toNode":"1b7a2018be9a2542","toSide":"left"},
|
||||
{"id":"f60c6e07e0ef6a98","fromNode":"c276871e8748cbfe","fromSide":"bottom","toNode":"b89cd7d463506018","toSide":"top"},
|
||||
{"id":"7fada69bb11ae874","fromNode":"154d88218d26f035","fromSide":"bottom","toNode":"c276871e8748cbfe","toSide":"top"},
|
||||
{"id":"d4c1beba2bea0171","fromNode":"bb0881e617ca2f52","fromSide":"bottom","toNode":"154d88218d26f035","toSide":"top","label":"SchemeGuid"},
|
||||
{"id":"7000cd2de2280a0a","fromNode":"1b7a2018be9a2542","fromSide":"right","toNode":"e724a0b36766d3a9","toSide":"left"},
|
||||
{"id":"82d29d89f73fd716","fromNode":"d34f3157e07cb50d","fromSide":"bottom","toNode":"034536d7a91d7b62","toSide":"top"},
|
||||
{"id":"035012a29ceb315e","fromNode":"034536d7a91d7b62","fromSide":"bottom","toNode":"197b4dc40754a989","toSide":"top"}
|
||||
]
|
||||
}
|
||||
15
21.01. OS/21.02. Windows/command.md
Normal file
15
21.01. OS/21.02. Windows/command.md
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
### 取得日期時間
|
||||
在 batch 檔裡面可以用 `%date%` 與 `%time%` 來取得日期時間。
|
||||
用 `%date:~0,4%` 來擷取特定欄位。
|
||||
`~0,4` 表示**從 index 0 開始取 4 位**,所以假設原本 `%date%` 會輸出 `2024/05/29`, `%date:~0,4%` 則會輸出 `2024`。
|
||||
|
||||
取得年、月、日、時、分、秒下:
|
||||
```bat
|
||||
set YYYY=%date:~0,4%
|
||||
set MM=%date:~5,2%
|
||||
set DD=%date:~8,2%
|
||||
set HOUR=%time:~0,2%
|
||||
set MIN=%time:~3,2%
|
||||
set SEC=%time:~6,2%
|
||||
```
|
||||
6
21.01. OS/21.02. Windows/powercfg powerthrottling.md
Normal file
6
21.01. OS/21.02. Windows/powercfg powerthrottling.md
Normal file
@@ -0,0 +1,6 @@
|
||||
對於特定的軟體,使用 `powercfg` 來關閉 powerthrottling。例如,讓 [VirtualBox](https://www.virtualbox.org/) 最大效能執行:
|
||||
```cmd
|
||||
powercfg /powerthrottling DISABLE /PATH "C:\Program Files\Oracle\VirtualBox\VirtualBoxVM.exe"
|
||||
powercfg /powerthrottling DISABLE /PATH "C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe"
|
||||
powercfg /powerthrottling list
|
||||
```
|
||||
16
21.01. OS/21.02. Windows/如何打造一個華麗又實用的 PowerShell 命令輸入環境.md
Normal file
16
21.01. OS/21.02. Windows/如何打造一個華麗又實用的 PowerShell 命令輸入環境.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "如何打造一個華麗又實用的 PowerShell 命令輸入環境"
|
||||
author:
|
||||
- "[[Will Huang]]"
|
||||
tags:
|
||||
- "clippings"
|
||||
date: "2025-04-11T17:56:44+08:00"
|
||||
time: "2025-04-11T17:56:44+08:00"
|
||||
description: "The Will Will Web - 記載著 Will 在網路世界的學習心得與技術分享 - 每次看到 Scott Hanselman 那套華麗的 PowerShell 命令輸入環境,就覺得自己一定也要設定一個類似的環境,不但使用起來讓人覺得神清氣爽,在同事朋友面前也會顯得出類拔萃。今天這篇文"
|
||||
source: "https://blog.miniasp.com/post/2021/11/24/PowerShell-prompt-with-Oh-My-Posh-and-Windows-Terminal"
|
||||
published: 2021-11-24
|
||||
---
|
||||
|
||||
|
||||
# 參考來源
|
||||
- [如何打造一個華麗又實用的 PowerShell 命令輸入環境](https://blog.miniasp.com/post/2021/11/24/PowerShell-prompt-with-Oh-My-Posh-and-Windows-Terminal)
|
||||
171
21.01. OS/21.02. Windows/安裝新版 Oh My Posh 與插件來美化 PowerShell.md
Normal file
171
21.01. OS/21.02. Windows/安裝新版 Oh My Posh 與插件來美化 PowerShell.md
Normal file
@@ -0,0 +1,171 @@
|
||||
---
|
||||
title: "安裝新版 Oh My Posh 與插件來美化 PowerShell"
|
||||
author:
|
||||
- "[[kwchang0831]]"
|
||||
tags:
|
||||
- "clippings"
|
||||
date: "2025-04-11T19:56:45+08:00"
|
||||
time: "2025-04-11T19:56:45+08:00"
|
||||
description: "本篇文章紀錄 使用 Oh My Posh 來美化 PowerShell 7(pwsh)並安裝一些插件讓開發環境更高效。 插件可以安裝 Posh Git 讓使用 Git 指令的時候有自動完成的功能,或是安裝 ZLocation 讓我們可以更快速地跳到想去的資料夾,等等..."
|
||||
source: "https://www.kwchang0831.dev/dev-env/pwsh/oh-my-posh"
|
||||
published: 2022-05-22
|
||||
---
|
||||
[kwchang0831](https://github.com/kwchang0831)
|
||||
|
||||
更新於2 年前
|
||||
|
||||
## 開頭
|
||||
|
||||
[Oh My Posh](https://ohmyposh.dev/) 是一個主題引擎可以美化 PowerShell 7 (pwsh)。
|
||||
|
||||
本篇文章紀錄 Oh My Posh 的安裝與主題置換來美化你的 pwsh,並可更改主題 (theme)。除此之外,我們還會新增幾個插件來擴充 pwsh 的功能性,進一步提高使用效率。包含指令自動完成,快速切換資料夾等等。
|
||||
|
||||
本篇文章會介紹以下套件的安裝:
|
||||
|
||||
- [Oh My Posh](https://ohmyposh.dev/)
|
||||
- [Git](https://community.chocolatey.org/packages/git)
|
||||
- [Posh-Git](https://github.com/dahlbyk/posh-git)
|
||||
- [ZLocation](https://github.com/vors/ZLocation)
|
||||
- [NeoFetch](https://github.com/dylanaraps/neofetch)
|
||||
|
||||
## 環境配置
|
||||
|
||||
- Windows 10
|
||||
- Windows Terminal
|
||||
- PowerShell 7
|
||||
|
||||
## 安裝 gsudo
|
||||
|
||||
推薦安裝 gsudo ,可以更方便地提升權限到系統管理員權限,
|
||||
請參考: [gsudo - 讓 Windows 也有 sudo 功能](https://www.kwchang0831.dev/dev-env/gsudo)
|
||||
|
||||
## 安裝 PowerShell 7
|
||||
|
||||
若還沒有安裝最新版的 PowerShell 7 ,
|
||||
請參考: [PowerShell 7 - 來安裝最新版的 PowerShell](https://www.kwchang0831.dev/dev-env/pwsh)
|
||||
|
||||
## 安裝 Windows Terminal
|
||||
|
||||
若還沒有安裝最新版的 Windows Terminal,
|
||||
請參考: [改用 Windows Terminal - 比 Cmder 更好用的現代終端機](https://www.kwchang0831.dev/dev-env/windows-terminal)
|
||||
|
||||
## 安裝 Git
|
||||
|
||||
若還沒有安裝 Git ,可以使用 [chocolatey](https://chocolatey.org/install) 來安裝。
|
||||
|
||||
使用 gsudo 取得一次性系統管理員權限來安裝
|
||||
|
||||
## 安裝 Oh My Posh
|
||||
|
||||
pwsh 輸入
|
||||
|
||||
用文字編輯器編輯 `$Profile`
|
||||
|
||||
添加以下,儲存後關閉。
|
||||
|
||||
## $Profile
|
||||
|
||||
重新開啟 Windows Terminal 後生效,或是輸入以下指令應用修改,
|
||||
|
||||
## 安裝 Patched 字型
|
||||
|
||||
為了 Oh My Posh 的主題可以正常顯示字型與圖示,下載以下字型包並安裝:
|
||||
|
||||
[https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip)
|
||||
|
||||
或是使用 `oh-my-posh` 來安裝。這邊必須使用 gsudo 取得一次性系統管理員權限來安裝。
|
||||
|
||||
### 更改字型
|
||||
|
||||
#### Windows Terminal
|
||||
|
||||
Ctrl +, 打開設定,選擇 PowerShell 7 的設定檔 `外觀 > 字型` ,將字型改成 `MesloLGS NF` 之後儲存。
|
||||
|
||||

|
||||
|
||||
#### PowerShell 7
|
||||
|
||||
以系統管理員身分執行 PowerShell 7(x64),更改字型為 `MesloLGS NF`
|
||||
|
||||

|
||||
|
||||
### 更改 Oh My Posh 主題
|
||||
|
||||
Oh My Posh 內建很多不同的主題 (theme),請查看 [官網](https://ohmyposh.dev/docs/themes)
|
||||
|
||||
或是輸入以下指令查看內建的主題與預覽,
|
||||
|
||||
確定好了主題,讓我們修改 `$Profile` 來設定預設要使用的主題,
|
||||
|
||||
把 `oh-my-posh init pwsh ...` 的部分後面加上 `--config "$env:POSH_THEMES_PATH\{主題名稱}.omp.json"` 。
|
||||
|
||||
例如
|
||||
|
||||
## $Profile
|
||||
|
||||
重新開啟 Windows Terminal 後生效,或是輸入以下指令應用修改,
|
||||
|
||||
## posh-git
|
||||
|
||||
[posh-git](https://github.com/dahlbyk/posh-git) 讓 Git 的指令可已用 Tab 自動完成。
|
||||
|
||||
pwsh 輸入來安裝
|
||||
|
||||
在 `$Profile` 檔案最後一行新增以下指令:
|
||||
|
||||
## ZLocation
|
||||
|
||||
[ZLocation](https://github.com/vors/ZLocation) 類似於 [autojump](https://github.com/wting/autojump) 或是 [Zsh-z](https://github.com/agkozak/zsh-z) 的插件,
|
||||
可以用關鍵字直接跳到想去的資料夾,比使用 `cd` 更快速。
|
||||
|
||||
1.安裝 ZLocation
|
||||
|
||||
用 PowerShell 輸入以下指令:
|
||||
|
||||
輸入 \[A\] Yes to All ,全部同意。
|
||||
|
||||
2.修改使用者設定
|
||||
|
||||
在 `$Profile` 檔案最後一行新增以下指令,
|
||||
|
||||
## $Profile
|
||||
|
||||
重新開啟 Windows Terminal 後生效,
|
||||
或是輸入以下指令應用修改,
|
||||
|
||||
### ZLocation 使用方式
|
||||
|
||||
查看已知的資料夾位置
|
||||
|
||||
進入包含此字串的資料夾,可以用 `Tab` 來選擇結果,如果有多個資料夾符合 doc 的話。
|
||||
|
||||
回到之前的資料夾
|
||||
|
||||
## (選用) 安裝 NeoFetch
|
||||
|
||||
NeoFetch 用來顯示電腦配置。
|
||||
|
||||
即使已經有安裝 git 了,這邊還是要安裝 git ,因為 neofetch 會直接使用 scoop 安裝的 git 。
|
||||
|
||||
打開 pwsh 輸入以下指令,
|
||||
|
||||
執行 NeoFech
|
||||
|
||||
## (選用) 舊版錯誤訊息
|
||||
|
||||
如果你看到以下錯誤訊息,
|
||||
|
||||
表示你過去是用 `Install-Module` 的方式安裝 Oh My Posh,如以下:
|
||||
|
||||
詳細情況請參考 [官方網站](https://ohmyposh.dev/docs/migrating) 。
|
||||
|
||||
### 解決辦法
|
||||
|
||||
刪除過去的版本。打開 pwsh 輸入
|
||||
|
||||
移除 `$Profile` 裡的 `Import-Module oh-my-posh`
|
||||
|
||||
然後回到 [最上面的開始](https://www.kwchang0831.dev/dev-env/pwsh/#an1-zhuang1-oh-my-posh) 的流程重新安裝。
|
||||
|
||||
# 參考來源
|
||||
- [安裝新版 Oh My Posh 與插件來美化 PowerShell](https://www.kwchang0831.dev/dev-env/pwsh/oh-my-posh)
|
||||
8
21.01. OS/21.02. Windows/設定CPU Power mode.md
Normal file
8
21.01. OS/21.02. Windows/設定CPU Power mode.md
Normal file
@@ -0,0 +1,8 @@
|
||||
用 [`PowerWriteACValueIndex()`](https://learn.microsoft.com/en-us/windows/win32/api/powersetting/nf-powersetting-powerwriteacvalueindex) 或是 `PowerWriteDCValueIndex()` 來設定,然後用 `PowerSetActiveScheme()` 使其生效。
|
||||
|
||||
關於 scheme 的 GUID: https://learn.microsoft.com/en-us/windows/win32/power/power-setting-guids
|
||||
|
||||
C#的使用:[C#使用WinAPI 修改电源设置,临时禁止笔记本合上盖子时睡眠(使用PowerGetActiveScheme等函数,以及C#对WINAPI的调用) - findumars - 博客园](https://www.cnblogs.com/findumars/p/6298724.html)
|
||||
使用 API 的例子:[qt - Disable CPU package idle states in Windows from C++ code - Stack Overflow](https://stackoverflow.com/questions/69346153/disable-cpu-package-idle-states-in-windows-from-c-code)
|
||||
|
||||
[API for Minimum(Maximum) Processor State , C++ - Stack Overflow](https://stackoverflow.com/questions/22523708/api-for-minimummaximum-processor-state-c)
|
||||
Reference in New Issue
Block a user