2024-10-20 19:53:44 +0100

This commit is contained in:
js0ny 2024-10-20 19:53:25 +01:00
parent bde5d89003
commit 488c69e301
12 changed files with 279 additions and 32 deletions

View file

@ -19,6 +19,7 @@ ${function:shcfg} = { code $PROFILE }
${function:reload} = { . $PROFILE }
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
Set-Alias "pwshcfg" "shcfg"
# C & C++ #
# Set-Alias "cl" "clang"
@ -51,6 +52,46 @@ Set-Alias "pip3" "pip"
${function:wsl1} = {wsl.exe --distribution Debian}
${function:wsl2} = {wsl.exe --distribution Ubuntu-22.04}
# Search Software #
function Get-AppPackageListRemote {
param(
[string]$Name
)
if (-not $Name) {
Write-Host "Please provide a package name."
return
}
Write-Host "Searching for $Name..."
Write-Host "=== winget ==="
winget search $Name
Write-Host "=== choco ==="
choco search $Name
}
Set-Alias "pkgsearch" "Get-AppPackageListRemote"
function Get-AppPackageListLocal {
winget list
choco list
scoop list
}
# Toggle Theme #
function Set-SystemTheme {
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"
$currentMode = Get-ItemProperty -Path $regPath -Name "AppsUseLightTheme"
if ($currentMode.AppsUseLightTheme -eq 1) {
Set-ItemProperty -Path $regPath -Name "AppsUseLightTheme" -Value 0
Write-Host "已切换到深色模式"
}
else {
Set-ItemProperty -Path $regPath -Name "AppsUseLightTheme" -Value 1
Write-Host "已切换到浅色模式"
}
}
Set-Alias "theme" "Set-SystemTheme"
# Miscs #
@ -62,6 +103,12 @@ Import-Module CompletionPredictor
### Misc ###
${function:qwen} = "ollama run qwen2.5:14b"
# ## Oh-My-Posh ##
# Oh-My-Posh init pwsh --config "$HOME\AppData\Local\Programs\oh-my-posh\themes\tokyonight_storm.omp.json" | Invoke-Expression
## Conda ##
#region conda initialize