mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
sync: from Windows
This commit is contained in:
parent
16d9d1348b
commit
fd3ecfd674
15 changed files with 2581 additions and 29 deletions
|
|
@ -7,7 +7,7 @@ Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object
|
|||
|
||||
# Shell Equivalents #
|
||||
Set-Alias "grep" "Select-String"
|
||||
${function:which} = { (Get-Command $args[0]).Path }
|
||||
${function:which} = { (Get-Command $args[0]) }
|
||||
|
||||
# Shell Configurations #
|
||||
${function:shcfg} = { code $PROFILE }
|
||||
|
|
@ -15,12 +15,6 @@ ${function:reload} = { & $PROFILE }
|
|||
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
|
||||
Set-Alias "pwshcfg" "shcfg"
|
||||
|
||||
# C & C++ #
|
||||
# Set-Alias "cl" "clang"
|
||||
# Set-Alias "clpp" "clang++"
|
||||
# ${function:clang} = { clang -std=c99 $args[0] }
|
||||
# ${function:clang++} = { clang -std=c++2b $args[0] }
|
||||
|
||||
# WSL #
|
||||
${function:wsl1} = {wsl.exe --distribution Arch}
|
||||
${function:wsl2} = {wsl.exe --distribution Ubuntu-22.04}
|
||||
|
|
@ -51,19 +45,7 @@ function Get-AppPackageListLocal {
|
|||
}
|
||||
|
||||
# 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 "dark-mode" "Set-SystemTheme" # Consistent with macOS (`dark-mode`)
|
||||
Set-Alias "dark-mode" "$DOTFILES/win/cmd/dark-mode.bat" # Consistent with macOS (`dark-mode`)
|
||||
|
||||
# Miscs #
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue