refractor: Reorganise dotfiles structures

This commit is contained in:
js0ny 2024-11-29 23:28:18 +00:00
parent 2bd9138a5f
commit bd5ca49c3e
131 changed files with 43 additions and 114 deletions

48
platforms/mac/.zshrc Normal file
View file

@ -0,0 +1,48 @@
# $XDG_CONFIG_HOME/zsh/.zshrc
# ln -s $DOTFILES/mac/.zshrc $XDG_CONFIG_HOME/zsh/.zshrc
### Variables ###
export DOTFILES="$HOME/.dotfiles"
export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:$PATH
for file in $DOTFILES/zsh/*.zsh; do
source $file
done
export ARCHFLAGS="-arch arm64"
### Navigation ###
# Absolute navigation
alias doku="cd ~/doku && ls"
alias docs="cd ~/Documents"
alias dt="cd ~/Desktop"
alias down="cd ~/Downloads"
alias one="cd ~/OneDrive"
alias gdrive="cd ~/Google\ Drive"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/homebrew/Caskroom/miniconda/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then
. "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh"
else
export PATH="/opt/homebrew/Caskroom/miniconda/base/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# >>> juliaup initialize >>>
# !! Contents within this block are managed by juliaup !!
path=('$HOME/.juliaup/bin' $path)
export PATH
# <<< juliaup initialize <<<
# macOS #
alias xclip="pbcopy"
alias clip="pbcopy"

View file

@ -0,0 +1,24 @@
# $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1
# ln -sf $DOTFILES/mac/Microsoft.PowerShell_profile.ps1 $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1
### Variables ###
$DOTFILES = "$HOME/.dotfiles"
### Load Configs ###
Get-ChildItem -Path $DOTFILES/powershell -Filter *.ps1 | ForEach-Object {. $_}
Get-ChildItem -Path $DOTFILES/powershell_private -Filter *.ps1 | ForEach-Object {. $_}
## Aliases ###
# PowerShell Equivalents #
# Set-Alias "curl" "Invoke-WebRequest"
# Set-Alias "man" "Get-Help"
Set-Alias "kill" "Stop-Process"
Set-Alias "open" "Invoke-Item" # Use ii instead of open
# Dev #
${function:zshcfg} = { nvim ~/.zshrc }
${function:bashcfg} = { nvim ~/.bashrc }

View file

@ -0,0 +1,26 @@
{
"description": "CapsLock to ESC (alone) or LCommand (withKeys)",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_command"
}
],
"to_if_alone": [
{
"key_code": "escape"
}
],
"type": "basic"
}
]
}

View file

@ -0,0 +1,24 @@
{
"description": "Map fn+tab to cmd+tab",
"manipulators": [
{
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": [
"fn"
]
}
},
"to": [
{
"key_code": "tab",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
}
]
}

View file

@ -0,0 +1,215 @@
{
"profiles": [
{
"complex_modifications": {
"rules": [
{
"description": "Caps Lock to Esc and Ctrl",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "left_control" }],
"to_if_alone": [{ "key_code": "escape" }],
"type": "basic"
}
]
},
{
"description": "Change left_control+hnei to arrow keys",
"manipulators": [
{
"from": {
"key_code": "h",
"modifiers": {
"mandatory": ["left_control"],
"optional": ["any"]
}
},
"to": [{ "key_code": "left_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "n",
"modifiers": {
"mandatory": ["left_control"],
"optional": ["any"]
}
},
"to": [{ "key_code": "down_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "e",
"modifiers": {
"mandatory": ["left_control"],
"optional": ["any"]
}
},
"to": [{ "key_code": "up_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "i",
"modifiers": {
"mandatory": ["left_control"],
"optional": ["any"]
}
},
"to": [{ "key_code": "right_arrow" }],
"type": "basic"
}
]
}
]
},
"devices": [
{
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 626,
"vendor_id": 5426
},
"ignore": false,
"mouse_flip_y": true,
"simple_modifications": [
{
"from": { "key_code": "left_command" },
"to": [{ "key_code": "right_control" }]
},
{
"from": { "key_code": "left_control" },
"to": [{ "key_code": "left_command" }]
}
]
},
{
"identifiers": {
"is_pointing_device": true,
"product_id": 45088,
"vendor_id": 1133
},
"ignore": false,
"mouse_flip_vertical_wheel": true
}
],
"name": "Default profile",
"selected": true,
"simple_modifications": [
{
"from": { "apple_vendor_top_case_key_code": "keyboard_fn" },
"to": [{ "key_code": "left_command" }]
},
{
"from": { "key_code": "left_command" },
"to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }]
}
],
"virtual_hid_keyboard": { "keyboard_type_v2": "ansi" }
},
{
"complex_modifications": {
"rules": [
{
"description": "Change left_control+hnei to arrow keys",
"manipulators": [
{
"from": {
"key_code": "h",
"modifiers": {
"mandatory": ["left_control"],
"optional": ["any"]
}
},
"to": [{ "key_code": "left_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "n",
"modifiers": {
"mandatory": ["left_control"],
"optional": ["any"]
}
},
"to": [{ "key_code": "down_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "e",
"modifiers": {
"mandatory": ["left_control"],
"optional": ["any"]
}
},
"to": [{ "key_code": "up_arrow" }],
"type": "basic"
},
{
"from": {
"key_code": "i",
"modifiers": {
"mandatory": ["left_control"],
"optional": ["any"]
}
},
"to": [{ "key_code": "right_arrow" }],
"type": "basic"
}
]
}
]
},
"devices": [
{
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 626,
"vendor_id": 5426
},
"ignore": false,
"mouse_flip_y": true,
"simple_modifications": [
{
"from": { "key_code": "left_command" },
"to": [{ "key_code": "right_control" }]
},
{
"from": { "key_code": "left_control" },
"to": [{ "key_code": "left_command" }]
}
]
},
{
"identifiers": {
"is_pointing_device": true,
"product_id": 45088,
"vendor_id": 1133
},
"ignore": false,
"mouse_flip_vertical_wheel": true
}
],
"name": "Default profile (copy)",
"simple_modifications": [
{
"from": { "apple_vendor_top_case_key_code": "keyboard_fn" },
"to": [{ "key_code": "left_command" }]
},
{
"from": { "key_code": "left_command" },
"to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }]
}
],
"virtual_hid_keyboard": { "keyboard_type_v2": "ansi" }
}
]
}

View file

@ -0,0 +1,4 @@
# Karabiner
- `karabiner.json` is the configuration file for Karabiner-Elements, located in `~/.config/karabiner/`.
- Other files are considered as snippets for the configuration file.

View file

@ -0,0 +1,21 @@
# $XDG_CONFIG_HOME/neovide/config.toml
# ln -sf $DOTFILES/mac/neovide.toml $XDG_CONFIG_HOME/neovide/config.toml
# New-Item -ItemType SymbolicLink -Path $Env:XDG_CONFIG_HOME/neovide/config.toml -Value $DOTFILES\mac\neovide.toml (Mac)
# https://neovide.dev/config-file.html?highlight=toml#config-file
fork = false
frame = "full"
idle = true
maximized = false
neovim-bin = "/opt/homebrew/bin/nvim"
no-multigrid = false
srgb = false
tabs = true
theme = "auto"
title-hidden = true
vsync = true
wsl = false
[font]
normal = ["CaskaydiaCove Nerd Font"] # Will use the bundled Fira Code Nerd Font by default
size = 14.0

0
platforms/mac/readme.md Normal file
View file

View file

@ -0,0 +1,33 @@
# pip
alias pip=pip3
alias python=python3
python -m pip install --upgrade pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# npm
npm config set registry https://registry.npmmirror.com
# Homebrew
# 手动设置
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
# 注:自 brew 4.0 起,大部分 Homebrew 用户无需设置 homebrew/core 和 homebrew/cask 镜像,只需设置 HOMEBREW_API_DOMAIN 即可。
# 如果需要使用 Homebrew 的开发命令 (如 `brew cat <formula>`),则仍然需要设置 homebrew/core 和 homebrew/cask 镜像。
# 请按需执行如下两行命令:
brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
# 除 homebrew/core 和 homebrew/cask 仓库外的 tap 仓库仍然需要设置镜像
brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-services.git
brew update
# 或使用下面的几行命令自动设置
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
for tap in core cask{,-fonts,-versions} command-not-found services; do
brew tap --custom-remote --force-auto-update "homebrew/${tap}" "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-${tap}.git"
done
brew update

View file

@ -0,0 +1,4 @@
tell application "Finder"
activate
make new Finder window
end tell

12
platforms/win/.wslconfig Normal file
View file

@ -0,0 +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
hostAddressLoopback=true

View file

@ -0,0 +1,110 @@
### Load Configs ###
$DOTFILES = "$HOME\.dotfiles"
Get-ChildItem -Path $DOTFILES\powershell -Filter *.ps1 | ForEach-Object {. $_}
Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object {. $_}
### Aliases ###
# Shell Equivalents #
Set-Alias "grep" "Select-String"
${function:which} = { (Get-Command $args[0]).Path }
# Shell Configurations #
${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"
# 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}
# Search Software #
function Find-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
# Too slow!
# Write-Host "=== scoop ==="
# scoop search $Name
}
Set-Alias "pkgsearch" "Find-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 "dark-mode" "Set-SystemTheme" # Consistent with macOS (`dark-mode`)
# Miscs #
### Misc ###
${function:qwen} = "ollama run qwen2.5:14b"
## Conda ##
#region conda initialize
# !! Contents within this block are managed by 'conda init' !!
If (Test-Path "$HOME\miniconda3\Scripts\conda.exe") {
(& "$HOME\miniconda3\Scripts\conda.exe" "shell.powershell" "hook") | Out-String | Where-Object{$_} | Invoke-Expression
}
#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
# 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

@ -0,0 +1,369 @@
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
},
"id": "User.copy.644BA8F2",
"keys": "ctrl+c"
},
{
"command": "paste",
"id": "User.paste",
"keys": "ctrl+v"
},
{
"command": "find",
"id": "User.find",
"keys": "ctrl+shift+f"
},
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"id": "User.splitPane.A6751878",
"keys": "alt+shift+d"
}
],
"alwaysShowNotificationIcon": true,
"copyFormatting": "none",
"copyOnSelect": false,
"defaultInputScope": "alphanumericHalfWidth",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"focusFollowMouse": false,
"language": "zh-Hans",
"minimizeToNotificationArea": false,
"newTabMenu":
[
{
"type": "remainingProfiles"
}
],
"profiles":
{
"defaults":
{
"adjustIndistinguishableColors": "always",
"antialiasingMode": "cleartype",
"autoMarkPrompts": true,
"backgroundImageOpacity": 0.3,
"colorScheme": "Catppuccin Mocha",
"compatibility.reloadEnvironmentVariables": false,
"experimental.retroTerminalEffect": false,
"font":
{
"colorGlyphs": true,
"face": "CaskaydiaCove Nerd Font",
"features":
{
"rlig": 1
}
},
"opacity": 40,
"scrollbarState": "visible",
"showMarksOnScrollbar": true,
"useAcrylic": true
},
"list":
[
{
"colorScheme": "Catppuccin Frappe",
"commandline": "\"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\\pwsh.exe\"",
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"opacity": 50,
"source": "Windows.Terminal.PowershellCore",
"tabTitle": "PS"
},
{
"colorScheme": "Tokyo Night",
"commandline": "C:\\WINDOWS\\system32\\wsl.exe -d Arch",
"guid": "{a5a97cb8-8961-5535-816d-772efe0c6a3f}",
"hidden": false,
"icon": "D:\\Assets\\Icons\\arch.png",
"name": "Arch",
"source": "Windows.Terminal.Wsl"
},
{
"colorScheme": "Catppuccin Macchiato",
"commandline": "\"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\\pwsh.exe\"",
"elevate": true,
"guid": "{ed7f021f-014d-4ca8-b3f2-811f745950db}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/pwsh.png",
"name": "Admin",
"opacity": 100,
"startingDirectory": "%USERPROFILE%",
"tabTitle": "Root"
},
{
"colorScheme": "Ubuntu-ColorScheme",
"commandline": "C:\\WINDOWS\\system32\\wsl.exe -d Ubuntu-22.04",
"font":
{
"face": "CaskaydiaCove Nerd Font"
},
"guid": "{c1061641-0172-4aec-b52d-dfc2b991553a}",
"hidden": false,
"icon": "D:\\Assets\\Icons\\ubuntu.png",
"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,
"name": "Git Bash",
"source": "Git"
},
{
"colorScheme": "Solarized Light",
"commandline": "\"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\\pwsh.exe\"",
"guid": "{39030c99-17fd-4feb-913f-c149a2826247}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/pwsh.png",
"name": "Light",
"opacity": 100,
"startingDirectory": "%USERPROFILE%",
"tabTitle": "PS",
"useAcrylic": true
}
]
},
"schemes":
[
{
"background": "#303446",
"black": "#51576D",
"blue": "#8CAAEE",
"brightBlack": "#626880",
"brightBlue": "#8CAAEE",
"brightCyan": "#81C8BE",
"brightGreen": "#A6D189",
"brightPurple": "#F4B8E4",
"brightRed": "#E78284",
"brightWhite": "#A5ADCE",
"brightYellow": "#E5C890",
"cursorColor": "#F2D5CF",
"cyan": "#81C8BE",
"foreground": "#C6D0F5",
"green": "#A6D189",
"name": "Catppuccin Frappe",
"purple": "#F4B8E4",
"red": "#E78284",
"selectionBackground": "#626880",
"white": "#B5BFE2",
"yellow": "#E5C890"
},
{
"background": "#EFF1F5",
"black": "#5C5F77",
"blue": "#1E66F5",
"brightBlack": "#ACB0BE",
"brightBlue": "#1E66F5",
"brightCyan": "#179299",
"brightGreen": "#40A02B",
"brightPurple": "#EA76CB",
"brightRed": "#D20F39",
"brightWhite": "#BCC0CC",
"brightYellow": "#DF8E1D",
"cursorColor": "#DC8A78",
"cyan": "#179299",
"foreground": "#4C4F69",
"green": "#40A02B",
"name": "Catppuccin Latte",
"purple": "#EA76CB",
"red": "#D20F39",
"selectionBackground": "#ACB0BE",
"white": "#ACB0BE",
"yellow": "#DF8E1D"
},
{
"background": "#24273A",
"black": "#494D64",
"blue": "#8AADF4",
"brightBlack": "#5B6078",
"brightBlue": "#8AADF4",
"brightCyan": "#8BD5CA",
"brightGreen": "#A6DA95",
"brightPurple": "#F5BDE6",
"brightRed": "#ED8796",
"brightWhite": "#A5ADCB",
"brightYellow": "#EED49F",
"cursorColor": "#F4DBD6",
"cyan": "#8BD5CA",
"foreground": "#CAD3F5",
"green": "#A6DA95",
"name": "Catppuccin Macchiato",
"purple": "#F5BDE6",
"red": "#ED8796",
"selectionBackground": "#5B6078",
"white": "#B8C0E0",
"yellow": "#EED49F"
},
{
"background": "#1E1E2E",
"black": "#45475A",
"blue": "#89B4FA",
"brightBlack": "#585B70",
"brightBlue": "#89B4FA",
"brightCyan": "#94E2D5",
"brightGreen": "#A6E3A1",
"brightPurple": "#F5C2E7",
"brightRed": "#F38BA8",
"brightWhite": "#A6ADC8",
"brightYellow": "#F9E2AF",
"cursorColor": "#F5E0DC",
"cyan": "#94E2D5",
"foreground": "#CDD6F4",
"green": "#A6E3A1",
"name": "Catppuccin Mocha",
"purple": "#F5C2E7",
"red": "#F38BA8",
"selectionBackground": "#585B70",
"white": "#BAC2DE",
"yellow": "#F9E2AF"
},
{
"background": "#1A1B2C",
"black": "#414868",
"blue": "#7AA2F7",
"brightBlack": "#414868",
"brightBlue": "#7AA2F7",
"brightCyan": "#7DCFFF",
"brightGreen": "#73DACA",
"brightPurple": "#BB9AF7",
"brightRed": "#F7768E",
"brightWhite": "#C0CAF5",
"brightYellow": "#E0AF68",
"cursorColor": "#C0CAF5",
"cyan": "#7DCFFF",
"foreground": "#A9B1DC",
"green": "#73DACA",
"name": "Tokyo Night",
"purple": "#BB9AF7",
"red": "#F7768E",
"selectionBackground": "#28344A",
"white": "#C0CAF5",
"yellow": "#E0AF68"
}
],
"showTabsInTitlebar": true,
"startOnUserLogin": true,
"tabWidthMode": "titleLength",
"theme": "Catppuccin Macchiato",
"themes":
[
{
"name": "Catppuccin Frappe",
"tab":
{
"background": "#303446FF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
{
"background": "#292C3CFF",
"unfocusedBackground": "#232634FF"
},
"window":
{
"applicationTheme": "dark",
"experimental.rainbowFrame": false,
"frame": null,
"unfocusedFrame": null,
"useMica": false
}
},
{
"name": "Catppuccin Latte",
"tab":
{
"background": "#EFF1F5FF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
{
"background": "#E6E9EFFF",
"unfocusedBackground": "#DCE0E8FF"
},
"window":
{
"applicationTheme": "light",
"experimental.rainbowFrame": false,
"frame": null,
"unfocusedFrame": null,
"useMica": false
}
},
{
"name": "Catppuccin Macchiato",
"tab":
{
"background": "#24273AFF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
{
"background": "#1E2030FF",
"unfocusedBackground": "#181926FF"
},
"window":
{
"applicationTheme": "dark",
"experimental.rainbowFrame": false,
"frame": null,
"unfocusedFrame": null,
"useMica": false
}
},
{
"name": "Catppuccin Mocha",
"tab":
{
"background": "#1E1E2EFF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
{
"background": "#181825FF",
"unfocusedBackground": "#11111BFF"
},
"window":
{
"applicationTheme": "dark",
"experimental.rainbowFrame": false,
"frame": null,
"unfocusedFrame": null,
"useMica": false
}
}
],
"useAcrylicInTabRow": true
}

View file

@ -0,0 +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 = true
[font]
normal = ["CaskaydiaCove Nerd Font"] # Will use the bundled Fira Code Nerd Font by default
size = 14.0

50
platforms/win/readme.md Normal file
View file

@ -0,0 +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
```

16
platforms/wsl/.bashrc Normal file
View file

@ -0,0 +1,16 @@
# Append to original bashrc for minimal setup
# echo $DOTFILES/wsl/.bashrc >> ~/.bashrc
bind 'set show-mode-in-prompt on'
set -o vi
bind -m vi-command '"n": next-history'
bind -m vi-command '"e": previous-history'
bind -m vi-command '"l": vi-insertion-mode'
bind -m vi-command '"L": vi-insert-beg'
bind -m vi-command '"i": forward-char'
# bind -m vi-insert '"\C-r": reverse-search-history"'
# bind -m vi-insert '"\C-l": clear-screen'
bind -m vi-command '"j": vi-end-word'
bind -m vi-command '"J": vi-end-word'

83
platforms/wsl/.zshrc Normal file
View file

@ -0,0 +1,83 @@
# $XDG_CONFIG_HOME/zsh/.zshrc
# ln -s $DOTFILES/wsl/.zshrc $XDG_CONFIG_HOME/zsh/.zshrc
### Variables ###
export IS_WSL=true
export DOTFILES="$HOME/.dotfiles"
for file in $DOTFILES/zsh/*.zsh; do
source $file
done
source $DOTFILES/wsl/winterop.zsh
source $ZDOTDIR/.zprivate.zsh
export ARCHFLAGS="-arch x86_64"
# Absolute navigation
alias src="cd ~/Source && ls"
alias dotfiles="cd $DOTFILES && ls"
### WSL Options ###
# WSL open
open() {
local target=$1
if command -v explorer.exe > /dev/null; then
explorer.exe "$target"
else
command open "$target"
fi
}
# WSL Neovide
gvi() {
local target=$1
if command -v neovide.exe > /dev/null; then
neovide.exe "$target"
else
if command -v neovide > /dev/null; then
neovide "$target"
else
echo "neovide is not installed"
fi
fi
}
### Misc ###
export PATH=/opt/bin:$PATH
# Conda #
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/js0ny/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/js0ny/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/js0ny/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/js0ny/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
if [ -f /usr/share/doc/pkgfile/command-not-found.sh ]; then
source /usr/share/doc/pkgfile/command-not-found.sh
fi
# vcpkg
export VCPKG_ROOT=~/vcpkg
# Package Manager
alias pac="sudo pacman"
alias paci="sudo pacman -S"
alias pacr="sudo pacman -R"
alias pacu="sudo pacman -Syu"

View file

@ -0,0 +1,15 @@
alias clip="clip.exe"
alias xclip="clip.exe"
alias paste='pwsh.exe -NoProfile -Command "Get-Clipboard"'
alias dark-mode='pwsh.exe -Command "dark-mode" 2>&1 /dev/null'
alias winfetch='pwsh.exe -NoProfile -Command "winfetch"'
alias psw="tasklist.exe"
alias killw="taskkill.exe"
alias shutdownw="shutdown.exe /s /t 0"
alias rebootw="shutdown.exe /r /t 0"
alias ipconfig="ipconfig.exe"
alias netstatw="netstat.exe"
alias diskpart="diskpart.exe"
alias winget="winget.exe"
alias pastew='pwsh.exe -NoProfile -Command "Get-Clipboard"'
alias ollama="ollama.exe"