Sync from Windows

This commit is contained in:
js0ny 2024-11-20 14:27:00 +00:00
parent 8a7397c426
commit d5f8d807b9
80 changed files with 6079 additions and 5097 deletions

View file

@ -1,12 +1,12 @@
# ~/.wslconfig
# New-Item -ItemType SymbolicLink -Path ~\.wslconfig -Target ~\.dotfiles\win\.wslconfig
[wsl2]
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true
[experimental]
# requires dnsTunneling but are also OPTIONAL
bestEffortDnsParsing=true
# ~/.wslconfig
# New-Item -ItemType SymbolicLink -Path ~\.wslconfig -Target ~\.dotfiles\win\.wslconfig
[wsl2]
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true
[experimental]
# requires dnsTunneling but are also OPTIONAL
bestEffortDnsParsing=true
hostAddressLoopback=true

View file

@ -39,6 +39,9 @@ function Find-AppPackageListRemote {
winget search $Name
Write-Host "=== choco ==="
choco search $Name
# Too slow!
# Write-Host "=== scoop ==="
# scoop search $Name
}
Set-Alias "pkgsearch" "Find-AppPackageListRemote"
function Get-AppPackageListLocal {
@ -94,3 +97,14 @@ if (-not ($__lastStartup -eq $_currentDate)) {
Remove-Variable SystemlogFilePath
Remove-Variable __lastStartup
Remove-Variable _currentDate
# Use some unix commands
${function:tree} = { wsl tree $args}
${function:ln} = { coreutils.exe ln $args}
${function:la} = { lsd.exe -la $args}
# Set default applications
$Env:PAGER = "less"
$Env:EDITOR = "code --wait"
$Env:VISUAL = "code --wait"
$Env:FILE_MANAGER = "dopus.exe"

View file

@ -1,10 +1,10 @@
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
"actions":
[
{
"command":
"command":
{
"action": "copy",
"singleLine": false
@ -23,7 +23,7 @@
"keys": "ctrl+shift+f"
},
{
"command":
"command":
{
"action": "splitPane",
"split": "auto",
@ -41,15 +41,15 @@
"focusFollowMouse": false,
"language": "zh-Hans",
"minimizeToNotificationArea": false,
"newTabMenu":
"newTabMenu":
[
{
"type": "remainingProfiles"
}
],
"profiles":
"profiles":
{
"defaults":
"defaults":
{
"adjustIndistinguishableColors": "always",
"antialiasingMode": "cleartype",
@ -58,11 +58,11 @@
"colorScheme": "Catppuccin Mocha",
"compatibility.reloadEnvironmentVariables": false,
"experimental.retroTerminalEffect": false,
"font":
"font":
{
"colorGlyphs": true,
"face": "CaskaydiaCove Nerd Font",
"features":
"features":
{
"rlig": 1
}
@ -72,7 +72,7 @@
"showMarksOnScrollbar": true,
"useAcrylic": true
},
"list":
"list":
[
{
"colorScheme": "Catppuccin Frappe",
@ -108,7 +108,7 @@
{
"colorScheme": "Ubuntu-ColorScheme",
"commandline": "C:\\WINDOWS\\system32\\wsl.exe -d Ubuntu-22.04",
"font":
"font":
{
"face": "CaskaydiaCove Nerd Font"
},
@ -118,6 +118,16 @@
"name": "Ubuntu",
"startingDirectory": "~"
},
{
"colorScheme": "Catppuccin Frappe",
"commandline": "C:\\Users\\citoy\\AppData\\Local\\Programs\\nu\\bin\\nu.exe",
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"opacity": 50,
"source": "Windows.Terminal.PowershellCore",
"tabTitle": "PS"
},
{
"guid": "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}",
"hidden": false,
@ -138,7 +148,7 @@
}
]
},
"schemes":
"schemes":
[
{
"background": "#303446",
@ -260,23 +270,23 @@
"startOnUserLogin": true,
"tabWidthMode": "titleLength",
"theme": "Catppuccin Macchiato",
"themes":
"themes":
[
{
"name": "Catppuccin Frappe",
"tab":
"tab":
{
"background": "#303446FF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
"tabRow":
{
"background": "#292C3CFF",
"unfocusedBackground": "#232634FF"
},
"window":
"window":
{
"applicationTheme": "dark",
"experimental.rainbowFrame": false,
@ -287,19 +297,19 @@
},
{
"name": "Catppuccin Latte",
"tab":
"tab":
{
"background": "#EFF1F5FF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
"tabRow":
{
"background": "#E6E9EFFF",
"unfocusedBackground": "#DCE0E8FF"
},
"window":
"window":
{
"applicationTheme": "light",
"experimental.rainbowFrame": false,
@ -310,19 +320,19 @@
},
{
"name": "Catppuccin Macchiato",
"tab":
"tab":
{
"background": "#24273AFF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
"tabRow":
{
"background": "#1E2030FF",
"unfocusedBackground": "#181926FF"
},
"window":
"window":
{
"applicationTheme": "dark",
"experimental.rainbowFrame": false,
@ -333,19 +343,19 @@
},
{
"name": "Catppuccin Mocha",
"tab":
"tab":
{
"background": "#1E1E2EFF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
"tabRow":
{
"background": "#181825FF",
"unfocusedBackground": "#11111BFF"
},
"window":
"window":
{
"applicationTheme": "dark",
"experimental.rainbowFrame": false,
@ -356,4 +366,4 @@
}
],
"useAcrylicInTabRow": true
}
}

View file

@ -1,15 +1,15 @@
fork = false
frame = "full"
idle = true
maximized = false
no-multigrid = false
srgb = false
tabs = true
theme = "auto"
title-hidden = true
vsync = false
wsl = false
[font]
normal = ["CaskaydiaCove Nerd Font"] # Will use the bundled Fira Code Nerd Font by default
size = 14.0
fork = false
frame = "full"
idle = true
maximized = false
no-multigrid = false
srgb = false
tabs = true
theme = "auto"
title-hidden = true
vsync = false
wsl = true
[font]
normal = ["CaskaydiaCove Nerd Font"] # Will use the bundled Fira Code Nerd Font by default
size = 14.0

View file

@ -1,50 +1,50 @@
# Windows dotfiles
By following the Windows Directory Standard, assign the following directories corresponding to `$XDG_CONFIG` in Unix:
- `%APPDATA%` - `$XDG_CONFIG_HOME` (default: `%USERPROFILE%\AppData\Roaming`)
## PowerShell Profile
This is the *[PowerShell Core](https://github.com/PowerShell/PowerShell)* profile, not the legacy *Windows PowerShell* profile.
By default, PowerShell profile is stored in `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1`.
It is convenient to use `$PROFILE` to locate the profile file.
```pwsh
Test-Path $PROFILE
```
To link the profile file:
```pwsh
New-Item -ItemType SymbolicLink -Path $PROFILE -Target "$DOTFILES\win\Microsoft.PowerShell_profile.ps1" -Force
```
I use [starship](https://starship.rs/) to customize the prompt, which is located in [`.dotfiles/.config/starship/starship_pwsh.toml`](../.config/starship/starship_pwsh.toml). This prompt config is cross-platform for powershell core, since I use the promp to identify the shell.
## `.wslconfig` - WSL Configuration
`.wslconfig` only supports `~/.wslconfig` as the configuration path
```pwsh
New-Item -ItemType SymbolicLink -Path "~\.wslconfig" -Target "$DOTFILES\win\.wslconfig" -Force
```
## Windows Terminal
Use Hard Link to sync Windows Terminal Settings since it doesn't support symlink.
```pwsh
New-Item -ItemType HardLink -Path "$Env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" -Target "$DOTFILES\win\WindowsTerminal.json" -Force
```
## Neovide
Neovide configuration is (only) stored in `%APPDATA%\neovide\config.toml`
```pwsh
New-Item -ItemType SymbolicLink -Path "$Env:AppData\neovide\config.toml" -Target "$DOTFILES\win\neovide.toml" -Force
# Windows dotfiles
By following the Windows Directory Standard, assign the following directories corresponding to `$XDG_CONFIG` in Unix:
- `%APPDATA%` - `$XDG_CONFIG_HOME` (default: `%USERPROFILE%\AppData\Roaming`)
## PowerShell Profile
This is the *[PowerShell Core](https://github.com/PowerShell/PowerShell)* profile, not the legacy *Windows PowerShell* profile.
By default, PowerShell profile is stored in `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1`.
It is convenient to use `$PROFILE` to locate the profile file.
```pwsh
Test-Path $PROFILE
```
To link the profile file:
```pwsh
New-Item -ItemType SymbolicLink -Path $PROFILE -Target "$DOTFILES\win\Microsoft.PowerShell_profile.ps1" -Force
```
I use [starship](https://starship.rs/) to customize the prompt, which is located in [`.dotfiles/.config/starship/starship_pwsh.toml`](../.config/starship/starship_pwsh.toml). This prompt config is cross-platform for powershell core, since I use the promp to identify the shell.
## `.wslconfig` - WSL Configuration
`.wslconfig` only supports `~/.wslconfig` as the configuration path
```pwsh
New-Item -ItemType SymbolicLink -Path "~\.wslconfig" -Target "$DOTFILES\win\.wslconfig" -Force
```
## Windows Terminal
Use Hard Link to sync Windows Terminal Settings since it doesn't support symlink.
```pwsh
New-Item -ItemType HardLink -Path "$Env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" -Target "$DOTFILES\win\WindowsTerminal.json" -Force
```
## Neovide
Neovide configuration is (only) stored in `%APPDATA%\neovide\config.toml`
```pwsh
New-Item -ItemType SymbolicLink -Path "$Env:AppData\neovide\config.toml" -Target "$DOTFILES\win\neovide.toml" -Force
```