diff --git a/.config/git/.gitconfig b/.config/git/.gitconfig index 494d67c..5c7266c 100644 --- a/.config/git/.gitconfig +++ b/.config/git/.gitconfig @@ -17,4 +17,6 @@ clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process - required = true \ No newline at end of file + required = true +[safe] + directory = %(prefix)///wsl.localhost/Arch/home/js0ny/inf2c/coursework-2-mips-simulator-js0ny diff --git a/powershell/Aliases.ps1 b/powershell/Aliases.ps1 index 29fff31..4f5741b 100644 --- a/powershell/Aliases.ps1 +++ b/powershell/Aliases.ps1 @@ -2,7 +2,7 @@ $EDITOR = "code" # Shell Equivalents # Set-Alias "touch" "New-Item" -${function:ll} = { Get-ChildItem -Force } +${function:ll} = { Get-ChildItem -Force } # Shell Configurations # ${function:shcfg} = { code $PROFILE } @@ -34,4 +34,13 @@ ${function:pyact} = { conda activate $args[0] } ${function:pydact} = { conda deactivate } ${function:pylsenvs} = { conda env list } ${function:pymkenv} = { conda create --name $args[0] } -${function:pyrmenv} = { conda remove --name $args[0] --all } \ No newline at end of file +${function:pyrmenv} = { conda remove --name $args[0] --all } + +# Winget # + +if ($isWindows) { + ${function:wini} = { winget install $args } + ${function:winr} = { winget uninstall $args } + ${function:wins} = { winget search $args } + ${function:winu} = { winget upgrade $args } +} diff --git a/setup/win_setup.ps1 b/setup/win_setup.ps1 index e7f1177..03fcf50 100644 --- a/setup/win_setup.ps1 +++ b/setup/win_setup.ps1 @@ -175,6 +175,7 @@ scoop install main/dos2unix # Convert line endings scoop install main/hyperfine # Benchmark scoop install main/bottom # System Monitor scoop install main/delta # diff +scoop install extras/gpg4win # File Management scoop install extras/everything diff --git a/win/.wslconfig b/win/.wslconfig index 1d6a486..2166134 100644 --- a/win/.wslconfig +++ b/win/.wslconfig @@ -1,12 +1,12 @@ # ~/.wslconfig # New-Item -ItemType SymbolicLink -Path ~\.wslconfig -Target ~\.dotfiles\win\.wslconfig [wsl2] -networkingMode=mirrored -dnsTunneling=true -firewall=true -autoProxy=true +# networkingMode=mirrored +# dnsTunneling=true +# firewall=true +# autoProxy=true [experimental] # requires dnsTunneling but are also OPTIONAL bestEffortDnsParsing=true -hostAddressLoopback=true \ No newline at end of file +hostAddressLoopback=true diff --git a/win/Microsoft.PowerShell_profile.ps1 b/win/Microsoft.PowerShell_profile.ps1 index 0cb0f30..f87965e 100644 --- a/win/Microsoft.PowerShell_profile.ps1 +++ b/win/Microsoft.PowerShell_profile.ps1 @@ -79,24 +79,24 @@ If (Test-Path "$HOME\miniconda3\Scripts\conda.exe") { #endregion ## Check Start Up ## -$SystemlogFilePath = "$env:USERPROFILE\.PowerShellStartup.log" -# 检查日志文件是否存在 -if (-not (Test-Path $SystemlogFilePath)) { - New-Item -Path $SystemlogFilePath -ItemType File -Force | Out-Null -} -# 读取日志文件的最后一行(即上次启动日期) -$__lastStartup = Get-Content -Path $SystemlogFilePath -Tail 1 -ErrorAction SilentlyContinue -$_currentDate = (Get-Date).ToString("yyyy-MM-dd") -if (-not ($__lastStartup -eq $_currentDate)) { - Get-Date - Update-ForexData & - Write-Host "今天是第一次启动 PowerShell。" - # 记录当前日期到日志文件 - $_currentDate | Out-File -FilePath $SystemlogFilePath -Append -} -Remove-Variable SystemlogFilePath -Remove-Variable __lastStartup -Remove-Variable _currentDate +#$SystemlogFilePath = "$env:USERPROFILE\.PowerShellStartup.log" +## 检查日志文件是否存在 +#if (-not (Test-Path $SystemlogFilePath)) { +# New-Item -Path $SystemlogFilePath -ItemType File -Force | Out-Null +#} +## 读取日志文件的最后一行(即上次启动日期) +#$__lastStartup = Get-Content -Path $SystemlogFilePath -Tail 1 -ErrorAction SilentlyContinue +#$_currentDate = (Get-Date).ToString("yyyy-MM-dd") +#if (-not ($__lastStartup -eq $_currentDate)) { +# Get-Date +# Update-ForexData & +# Write-Host "今天是第一次启动 PowerShell。" +# # 记录当前日期到日志文件 +# $_currentDate | Out-File -FilePath $SystemlogFilePath -Append +#} +#Remove-Variable SystemlogFilePath +#Remove-Variable __lastStartup +#Remove-Variable _currentDate # Use some unix commands ${function:tree} = { wsl tree $args}