This commit is contained in:
js0ny 2024-11-17 14:32:20 +00:00
commit 808ae43abb
15 changed files with 459 additions and 184 deletions

283
setup/mac_setup.sh Normal file
View file

@ -0,0 +1,283 @@
#! /bin/sh
# This script is used to setup a new mac
# In a new mac (Sequoia)
# Enter the following command in the terminal
#! curl -fsSL https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/setup/mac_setup.sh | sh # Do not use this command
echo "Running the setup script"
# Xcode Command Line Tools
echo "[INFO] Installing Xcode Command Line Tools"
echo "[ACTION] Request Human Takeover"
xcode-select --install
# System Preferences
# Installation Sources
echo "[INFO] Setting Installation Sources"
# sudo spctl --master-disable
# In Mac OS Sequoia, the command above is not working
# Should be set up manually (System Preferences -> Security & Privacy -> General -> Allow apps downloaded from: Anywhere)
## Finder
echo "[INFO] Setting Finder Preferences"
defaults write com.apple.finder QuitMenuItem -bool true # Quit with CMD+Q
defaults write com.apple.finder AppleShowAllFiles -bool false # Don't show Hidden Files
defaults write com.apple.finder ShowPathbar -bool true # Show Path Bar
defaults write com.apple.finder ShowStatusBar -bool true # Show Status Bar
defaults write NSGlobalDomain AppleShowAllExtensions -bool true # Show All File Extensions
defaults write com.apple.finder AppleShowAllFiles -bool true # Show Hidden Files
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Documents" # Open New Finder Windows in Documents
defaults write com.apple.finder _FXSortFoldersFirst -bool true
defaults write com.apple.finder FinderSpawnTab -bool true
# Don't show External Hard Drives on Desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowMountedServersOnDesktop -bool false
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
# No DS_Store on Network
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Keyboard
# Disable Accent Menu
defaults write NSGlobalDomain ApplePressAndHoldEnabled -boolean false
killall Finder
killall Dock
## Dock
echo "[INFO] Setting Dock Preferences"
defaults write com.apple.dock persistent-apps -array
defaults write com.apple.dock persistent-others -array
defaults write com.apple.dock autohide -bool true # Autohide Dock
defaults write com.apple.dock autohide-time-modifier -float 0.5
defaults write com.apple.dock autohide-delay -float 0 # Immediately Autohide Dock
defaults write com.apple.dock show-recents -bool false # Hide Recent Applications
killall Dock
## Trackpad
echo "[INFO] Setting Trackpad Preferences"
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -bool true
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -bool true
defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
# Development #
### Dotfiles Setup ###
echo "[INFO] Setting Up Dotfiles"
export DOTFILES="$HOME/.dotfiles"
git clone https://www.github.com/js0ny/dotfiles.git ~/.dotfiles
sudo cp ~/.dotfiles/zsh/.zshenv /etc/zshenv
echo "[INFO] 'source etc/zshenv' to use XDG_CONFIG_HOME"
source /etc/zshenv
# export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
# export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
echo "[INFO] Setting Up Zsh for Initial Use"
mkdir -p $ZDOTDIR
ln -sf $DOTFILES/zsh/.zshenv $ZDOTDIR/.zshenv
ln -sf $DOTFILES/mac/.zshrc $ZDOTDIR/.zshrc
mv ~/.zprofile $ZDOTDIR/.zprofile
source $ZDOTDIR/.zshrc
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/custom/plugins/zsh-syntax-highlighting
source /etc/zshenv
source $ZDOTDIR/.zshrc
rm -f ~/.zshrc ~/.zprofile ~/.zsh_history ~/.zshenv
rm -rf ~/.zsh_sessions
echo "[INFO] Setting Up dotfiles"
. $DOTFILES/setup/set_symblink_unix.sh
# $DOTFILES/mac
ln -sf $DOTFILES/mac/neovide.toml $XDG_CONFIG_HOME/neovide/config.toml
ln -sf $DOTFILES/mac/Microsoft.PowerShell_profile.ps1 $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1
# Brew
echo "[INFO] Installing Homebrew"
echo "[ACTION] Request Human Input"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "[INFO] Installing Softwares"
# Tap
brew tap daipeihust/tap # for `im-select`
brew tap homebrew/cask-fonts
brew install mas # Mac App Store CLI
# CLI
# brew install --formula cfiles # Not Available
# File Management
brew install --formula bat
brew install --formula fzf
brew install --formula glow # Markdown Preview
brew install --formula less # Pager, overwrites system less, no XDG support
brew install --formula ripgrep
brew install --formula tree
brew install --formula lsd
# Network
brew install --formula wget
brew install --formula wget2
brew install --formula speedtest-cli
# Development
brew install --formula cmake
brew install --formula lazygit
# Shell
brew install --formula starship # Shell Prompt
brew install --formula tmux
brew install --formula zellij
# System Info
brew install --formula fastfetch # 這輩子有了
# Utilities
brew install --formula ffmpeg
brew install --formula daipeihust/tap/im-select # IME Selector (for Vim modes)
brew install --formula pandoc
brew install --formula tldr
# File Management
brew install --cask keka # Archiver
brew install --cask google-drive # `sudo` # Cloud Storage
# Editors
brew install --formula vim # Overwrite System Vim since no XDG support
brew install --cask visual-studio-code
brew install --formula neovim
brew install --formula neovide
# IDE
brew install --cask qt-creator
brew install --cask rider
# Programming Languages
brew install --formula lua
brew install --formula luajit
brew install --formula luarocks
brew install --formula node
brew install --formula dotnet
brew install --formula go
# brew install --formula rust
brew install --cask miniconda
# PowerShells
brew install --cask powershell # `sudo`
# Launchers
brew install --cask raycast
brew install --cask utools
# Terminals
brew install --cask iterm2
# IME
brew install --cask squirrel # `sudo`
# PKM
brew install --cask obsidian
brew install --cask typora
brew install --cask notion
brew install --cask notion-calendar
# Media
brew install --cask iina
# Security
brew install --cask keyguard
# Engineering
brew install --cask ltspice # `sudo`
# Office
brew install --cask mactex-no-gui
# Browser
brew install --cask microsoft-edge # Default
brew install --cask arc
brew install --cask firefox@nightly
# Fonts
brew install --cask font-caskaydia-cove-nerd-font
brew install --cask font-lxgw-wenkai
# Quick Look
brew install --cask qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize suspicious-package apparency quicklookase qlvideo
# Utilities
brew install --cask rustdesk
# brew install --cask logi-options+ # NBCS
mas install 1452453066 # Hidden Bar
brew install ticktick # To-do List
brew install --cask zotero # Reference Manager
brew install --cask betterdisplay
brew install --cask karabiner-elements # Keyboard Customization
brew install --cask scroll-reverser # Let Trackpad and Mouse Scroll in the Same Direction like Windows
# brew install --cask orbstack # VM
# brew install --cask docker
brew install --cask clash-verge-rev
brew install --cask chatbox # LLM API Caller
brew install --cask follow # RSS Reader
# Social
brew install --cask telegram-desktop
mas install 836500024 # WeChat
mas install 451108668 # QQ
# plum (Rime IME)
curl -fsSL https://raw.githubusercontent.com/rime/plum/master/rime-install | bash
# Set default apps (duti)
# The id of the app can be found by running
# `osascript -e 'id of app "AppName"'`
brew install --formula duti
echo "[INFO] Setting Default Apps"
# Markdown -> Typora
duti -s abnerworks.Typora .md all
duti -s abnerworks.Typora .markdown all
# PDF -> Skim
duti -s net.sourceforge.skim-app.skim .pdf all
# Raw Text -> Neovide
duti -s com.neovide.neovide .txt all
# Archive -> Keka
duti -s com.aone.keka .zip all
duti -s com.aone.keka .rar all
duti -s com.aone.keka .7z all
duti -s com.aone.keka .tar all
# Source Code Light -> Neovim
duti -s com.neovide.neovide .gitingore all
duti -s com.neovide.neovide .vimrc all
duti -s com.neovide.neovide .vim all
duti -s com.neovide.neovide .lua all
duti -s com.neovide.neovide .py all
duti -s com.neovide.neovide .jl all
# Source Code Heavy -> VSCode
duti -s com.microsoft.VSCode .c all
# Source Code DOTNET -> VSCode
duti -s com.microsoft.VSCode .cs all
duti -s com.microsoft.VSCode .fs all
duti -s com.microsoft.VSCode .fsx all
duti -s com.microsoft.VSCode .csx all
duti -s com.microsoft.VSCode .ps1 all
# Source Code Web -> VSCode
duti -s com.microsoft.VSCode .js all
duti -s com.microsoft.VSCode .ts all
duti -s com.microsoft.VSCode .jsx all
duti -s com.microsoft.VSCode .tsx all
duti -s com.microsoft.VSCode .css all
duti -s com.microsoft.VSCode .scss all
duti -s com.microsoft.VSCode .sass all
duti -s com.microsoft.VSCode .vue all
# Source Code Config -> Neovim
duti -s com.neovide.neovide .json all
duti -s com.neovide.neovide .yaml all
duti -s com.neovide.neovide .yml all
duti -s com.neovide.neovide .toml all
duti -s com.neovide.neovide .ini all
duti -s com.neovide.neovide .cfg all
duti -s com.neovide.neovide .conf all
duti -s com.neovide.neovide .kdl all
duti -s com.neovide.neovide .xml all
# Source Code Jupyter -> VSCode
duti -s com.microsoft.VSCode .ipynb all
# Source Code DotNet Project -> Rider
duti -s com.jetbrains.rider .sln all
duti -s com.jetbrains.rider .csproj all
duti -s com.jetbrains.rider .fsproj all
# Video -> IINA
duti -s com.colliderli.iina .mp4 all
duti -s com.colliderli.iina .mkv all
mkdir -p $DOTFILES/powershell_private
touch $ZDOTDIR/.private.env.sh

View file

@ -0,0 +1,22 @@
#! /bin/sh
mkdir -p $XDG_CONFIG_HOME/conda $XDG_CONFIG_HOME/git $XDG_CONFIG_HOME/ideavim $XDG_CONFIG_HOME/markdownlint $XDG_CONFIG_HOME/pip $XDG_CONFIG_HOME/neovide $XDG_CONFIG_HOME/powershell $XDG_CONFIG_HOME/vscode $XDG_CONFIG_HOME/NuGet $XDG_CONFIG_HOME/vim $XDG_CONFIG_HOME/tmux $XDG_CONFIG_HOME/npm
mkdir -p ~/.config/zellij # Not support XDG_CONFIG_HOME but same directory
mkdir -p $WAKATIME_HOME
mkdir -p $XDG_STATE_HOME/vim/undo $XDG_STATE_HOME/vim/backup $XDG_STATE_HOME/vim/swap $XDG_STATE_HOME/vim/view
# $DOTFILES/.config
ln -sf $DOTFILES/.config/conda/condarc.yaml $XDG_CONFIG_HOME/conda/.condarc
ln -sf $DOTFILES/.config/git/.gitconfig $XDG_CONFIG_HOME/git/config
ln -sf $DOTFILES/.config/ideavim/ideavimrc.vimrc $XDG_CONFIG_HOME/ideavim/ideavimrc
ln -sf $DOTFILES/.config/markdownlint/.markdownlint.json $XDG_CONFIG_HOME/markdownlint/markdownlint.json
ln -sf $DOTFILES/.config/npm/npmrc $NPM_CONFIG_USERCONFIG
ln -sf $DOTFILES/.config/NuGet/NuGet.Config $XDG_CONFIG_HOME/NuGet/NuGet.Config
ln -sf $DOTFILES/.config/nvim/ $XDG_CONFIG_HOME/nvim
ln -sf $DOTFILES/.config/pip/pip.conf $XDG_CONFIG_HOME/pip/pip.conf
ln -sf $DOTFILES/.config/tmux/tmux.conf $XDG_CONFIG_HOME/tmux/tmux.conf
ln -sf $DOTFILES/.config/vim/vimrc $XDG_CONFIG_HOME/vim/vimrc
ln -sf $DOTFILES/.config/zellij/config.kdl ~/.config/zellij/config.kdl
ln -sf $DOTFILES/.config/lesskey $XDG_CONFIG_HOME/lesskey
# $DOTFILES/vscode
ln -sf $DOTFILES/vscode/vscode.vimrc $XDG_CONFIG_HOME/vscode.vimrc
# $DOTFILES root
ln -sf $DOTFILES/.haskeline ~/.haskeline

263
setup/win_setup.ps1 Normal file
View file

@ -0,0 +1,263 @@
#!C:\Program Files\WindowsApps\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\pwsh.EXE
# Run with PowerShell 7
winget install -e --id Git.Git
git clone https://github.com/js0ny/dotfiles.git ~\.dotfiles
Set-Location -Path ~\.dotfiles
Remove-Item -Force $PROFILE
$DOTFILES = "$HOME\.dotfiles"
New-Item -ItemType SymbolicLink -Path $PROFILE -Target "$DOTFILES\win\Microsoft.PowerShell_profile.ps1"
. $PROFILE
# Install Scoop
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
# Install Chocolatey
# Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Set Environment Variables
# Use %PATH_EXT% to prevent PATH from being too long
[System.Environment]::SetEnvironmentVariable("Path_EXT_0", "D:\bin", "User")
[System.Environment]::SetEnvironmentVariable("Path_EXT_1", "", "User")
[System.Environment]::SetEnvironmentVariable("Path_EXT_2", "", "User")
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", "User")
if ($currentPath -notlike "*%PATH_EXT%*") {
$currentPath += ";%PATH_EXT_0%;%PATH_EXT_1%;%PATH_EXT_2%"
}
[System.Environment]::SetEnvironmentVariable("Path", $currentPath, "User")
[System.Environment]::SetEnvironmentVariable("PATH_EXT_0", "", [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable("PATH_EXT_1", "", [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable("PATH_EXT_2", "", [System.EnvironmentVariableTarget]::Machine)
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine)
if ($currentPath -notlike "*%PATH_EXT%*") {
$currentPath += ";%PATH_EXT_0%;%PATH_EXT_1%;%PATH_EXT_2%"
}
[System.Environment]::SetEnvironmentVariable("Path", $currentPath, [System.EnvironmentVariableTarget]::Machine)
# Simulate XDG Base Directory Specification
$Env:XDG_CONFIG_HOME = "$Env:AppData"
$Env:XDG_DATA_HOME = "$Env:LocalAppData"
$Env:XDG_CACHE_HOME = "$Env:LocalAppData\cache"
$Env:XDG_STATE_HOME = "$Env:LocalAppData\state"
[System.Environment]::SetEnvironmentVariable("XDG_CONFIG_HOME", "$Env:XDG_CONFIG_HOME", "User")
[System.Environment]::SetEnvironmentVariable("XDG_DATA_HOME", "$Env:XDG_DATA_HOME", "User")
New-Item -ItemType Directory -Path "$Env:LocalAppData\cache" -Force
[System.Environment]::SetEnvironmentVariable("XDG_CACHE_HOME", "$Env:XDG_CACHE_HOME", "User")
New-Item -ItemType Directory -Path "$Env:LocalAppData\state" -Force
[System.Environment]::SetEnvironmentVariable("XDG_STATE_HOME", "$Env:XDG_STATE_HOME", "User")
# Add environment variables
[System.Environment]::SetEnvironmentVariable("DOTFILES", "$DOTFILES", "User")
# Set potential environment variables to prevent softwares put their configs in the wrong place
# eg. dotfiles in %UserProfile%
# ~\.aws -> %AppData%\aws :: AWS CLI
New-Item -ItemType Directory -Path "$Env:AppData\aws" -Force
[System.Environment]::SetEnvironmentVariable("AWS_CONFIG_FILE", "$Env:AppData\aws\config", "User")
[System.Environment]::SetEnvironmentVariable("AWS_SHARED_CREDENTIALS_FILE", "$Env:AppData\aws\credentials", "User")
# ~\.azure -> %LocalAppData%\Azure :: Azure CLIcargo install --list
[System.Environment]::SetEnvironmentVariable("AZURE_CONFIG_DIR", "$Env:LocalAppData\Azure", "User")
# ~\.cargo -> %LocalAppData%\Cargo :: Rust https://doc.rust-lang.org/cargo/guide/cargo-home.html
[System.Environment]::SetEnvironmentVariable("CARGO_HOME", "$Env:LocalAppData\Cargo", "User")
# ~\.docker -> %AppData%\dotDocker :: Docker (Docker takes %AppData%\Docker, use dotDocker instead)
[System.Environment]::SetEnvironmentVariable("DOCKER_CONFIG", "$Env:AppData\dotDocker", "User")
# ~\.dotnet -> %LocalAppData%\dotNET :: .NET Core
[System.Environment]::SetEnvironmentVariable("DOTNET_CLI_HOME", "$Env:LocalAppData\dotNET", "User")
# ~\.emacs.d -> %AppData%\.emacs.d :: Emacs (This is default)
# [System.Environment]::SetEnvironmentVariable("EMACS_HOME", "$Env:AppData\emacs.d", "User")
# ~\go -> %LocalAppData%\GO :: golang
[System.Environment]::SetEnvironmentVariable("GOPATH", "$Env:LocalAppData\GO", "User")
# ~\.ipython -> %AppData%\ipython :: IPython
# IPython won't check XDG on Windows https://github.com/ipython/ipython/blob/0615526f80691452f2e282c363bce197c0141561/IPython/utils/path.py#L200
[System.Environment]::SetEnvironmentVariable("IPYTHONDIR", "$Env:AppData\ipython", "User")
# ~\.julia -> %LocalAppData%\julia :: Julia
[System.Environment]::SetEnvironmentVariable("JULIA_DEPOT_PATH", "$Env:LocalAppData\julia", "User")
# ~\_lesshst -> %LocalAppData%\state\lesshst :: less
[System.Environment]::SetEnvironmentVariable("LESSHISTFILE", "$Env:XDG_STATE_HOME\lesshst", "User")
# %AppData%\less\lesskey :: less
New-Item -ItemType Directory -Path "$Env:AppData\less" -Force
[System.Environment]::SetEnvironmentVariable("LESSKEYIN", "$Env:AppData\less\lesskey", "User")
# ~\.matplotlib -> %LocalAppData%\matplotlib :: Matplotlib
[System.Environment]::SetEnvironmentVariable("MPLCONFIGDIR", "$Env:LocalAppData\matplotlib", "User")
# ~\.npmrc -> %AppData%\npm\npmrc :: npm
[System.Environment]::SetEnvironmentVariable("NPM_CONFIG_USERCONFIG", "$Env:AppData\npm\npmrc", "User")
# ~\.node_repl_history -> %LocalAppData%\state\node\repl_history :: Node.js
New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\node" -Force
[System.Environment]::SetEnvironmentVariable("NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\repl_history", "User")
# ~\.ts_node_repl_history -> %LocalAppData%\state\node\ts_node_repl_history :: Node.js
[System.Environment]::SetEnvironmentVariable("TS_NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\ts_node_repl_history", "User")
# ~\.nuget\packages -> %LocalAppData%\cache\NuGet\packages :: NuGet
[System.Environment]::SetEnvironmentVariable("NUGET_PACKAGES", "$Env:XDG_CACHE_HOME\NuGet\packages", "User")
# ~\.omnisharp -> %AppData%\OmniSharp :: OmniSharp
[System.Environment]::SetEnvironmentVariable("OMNISHARPHOME", "$Env:AppData\OmniSharp", "User")
# ~\.python_history -> %LocalAppData%\state\python\python_history :: Python
# Only works for Python 3.13+ https://docs.python.org/3.13/using/cmdline.html#envvar-PYTHON_HISTORY
New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\python" -Force
[System.Environment]::SetEnvironmentVariable("PYTHON_HISTORY", "$Env:XDG_STATE_HOME\python\python_history", "User")
# ~\.rustup -> %LocalAppData%\Rustup :: Rust
[System.Environment]::SetEnvironmentVariable("RUSTUP_HOME", "$Env:LocalAppData\Rustup", "User")
# ~\.vimrc -> %AppData%\Vim\_vimrc :: Vim
New-Item -ItemType Directory -Path "$Env:AppData\Vim" -Force
[System.Environment]::SetEnvironmentVariable("VIM", "$Env:AppData\Vim", "User")
# ~\.vuerc -> %AppData%\vue\.vuerc :: Vue CLI
# Currently, Vue CLI doesn't support file path configuration:https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli/lib/confifile
# [System.Environment]::SetEnvironmentVariable("VUE_CLI_CONFIG_PATH", "$Env:AppData\vue\.vuerc", "User")
# ~\.wget-hsts -> %LocalAppData%\cache\wget-hsts :: wget
# Use Alias, wget host file path is not configurable
# ~\.yarnrc -> %AppData%\yarn\config.yaml :: Yarn v1
# Use Alias, yarnrc path is not configurable
# Reload required here to make sure the environment variables are set
# Set Dotfiles
# $DOTFILES\.config
$folders = @("conda", "git", "ideavim", "ipython", "markdownlint", "npm", "NuGet", "nvim", "pip", "Vim")
foreach ($folder in $folders) {
New-Item -ItemType Directory -Path "$Env:XDG_CONFIG_HOME\$folder" -Force
}
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\conda\.condarc" -Target "$DOTFILES\.config\conda\condarc.yaml" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\git\config" -Target "$DOTFILES\.config\git\.gitconfig" -Force
New-Item -ItemType SymbolicLink -Path "~\.haskeline" -Target "$DOTFILES\.haskeline" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\ideavim\.ideavimrc" -Target "$DOTFILES\.config\ideavim\.ideavimrc" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\ipython" -Target "$DOTFILES\.config\ipython" -Force
# New-Item -ItemType SymbolicLink -Path "~\.markdownlint.json" -Target "$DOTFILES\.markdownlint.json" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\npm\npmrc" -Target "$DOTFILES\.config\npm\npmrc" -Force
New-Item -ItemType SymbolicLink -Path "$Env:AppData\NuGet\NuGet.Config" -Target "$DOTFILES\.config\NuGet\NuGet.Config" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\nvim" -Target "$DOTFILES\.config\nvim" -Force
New-Item -ItemType SymbolicLink -Path "$Env:AppData\pip\pip.ini" -Target "$DOTFILES\.config\pip\pip.conf" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\Vim\_vimrc" -Target "$DOTFILES\.config\vim\vimrc" -Force
New-Item -ItemType SymbolicLink -Path "~\.wslconfig" -Target "$DOTFILES\win\.wslconfig" -Force
New-Item -ItemType SymbolicLink -Path "$Env:AppData\neovide\config.toml" -Target "$DOTFILES\win\neovide.toml" -Force
# New-Item -ItemType SymbolicLink -Path "~\.vscode.vimrc" -Target "$DOTFILES\vscode\vscode.vimrc" Use Absolute Path
# Hide dotfiles
Get-ChildItem -Force -Filter .* -Path $HOME | ForEach-Object { $_.Attributes += "Hidden" }
@(
Join-Path $HOME '.config'
Join-Path $HOME '.dotfiles'
) | ForEach-Object {
$_.Attributes -band -bnot [System.IO.FileAttributes]::Hidden
}
Set-Location $HOME\Documents
# Match WindowsPowerShell and PowerShell
Get-ChildItem -Force -Filter *owerShell | ForEach-Object { $_.Attributes += "Hidden" }
# Windows Terminal
if (Get-Command wt -ErrorAction SilentlyContinue) {
Write-Output "Windows Terminal (wt) installed"
} else {
winget install -e --id Microsoft.WindowsTerminal
}
# Uninstall Windows Apps
Get-AppxPackage *solit* | Remove-AppxPackage # 纸牌
Get-AppxPackage *sound* | Remove-AppxPackage # 錄音機
Get-AppxPackage *camera* | Remove-AppxPackage # 相機
Get-AppxPackage *weather* | Remove-AppxPackage # 天氣
Get-AppxPackage *Map* | Remove-AppxPackage # 地圖
# Get-AppxPackage *clipchamp* | Remove-AppxPackage # 其實這個還行
# Added Packages
scoop bucket add main
scoop bucket add nerd-fonts
scoop bucket add extras
scoop bucket add nonportable
# CLI Tools
# winget install -e --id GnuWin32.Grep # Use Select-String instead
scoop install main/make
# winget install -e --id GnuWin32.Which # Use Get-Command instead
scoop install main/fzf
scoop install main/ripgrep
scoop install main/wget
scoop install main/wget2
scoop install main/cmake
scoop install main/bat
scoop install main/zoxide
scoop install main/dos2unix
# File Management
scoop install extras/everything
scoop install main/7zip
scoop install extras/bandizip
scoop install main/pandoc
scoop install extras/sumatrapdf
winget install -e --id Google.GoogleDrive
# System Enhancements
scoop install extras/fancontrol
scoop install extras/powertoys
scoop install extras/msiafterburner
winget install -e --id Yuanli.uTools
scoop install extras/geekuninstaller
scoop install extras/flow-launcher
# winget install -e --id AutoHotkey.AutoHotkey
scoop install extras/autohotkey
scoop install nonportable/mactype-np
scoop install extras/diskgenius
# winget install -e --id Nilesoft.Shell
# scoop install umi-ocr-paddle
# Editor
scoop install main/vim
scoop install main/neovim
scoop install extras/vscodium
scoop install extras/vscode
scoop install extras/neovide
# Security
scoop bucket add keyguard https://github.com/AChep/keyguard-repo-scoop
scoop install keyguard/keyguard
# PKM
scoop install extras/obsidian
winget install -e --id 9P7HPMXP73K4 # Siyuan
scoop install extras/typora
scoop install extras/zotero
scoop install extras/anki
# winget install -e --id Notion.Notion
# Browser
# Use Microsoft Edge directly
# winget install -e --id TheBrowserCompany.Arc
# winget install -e --id Mozilla.Firefox.Nightly # Not working
# Programming Languages
winget install -e --id Python.Python.3.13
winget install -e --id Anaconda.Miniconda3
winget install -e --id OpenJS.NodeJS
winget install -e --id Rustlang.Rustup
winget install -e --id Microsoft.DotNet.SDK.8
# Dev
scoop install extras/docker
scoop install extras/lazygit
# IDE
scoop install extras/rider
# Gaming
winget install -e --id Valve.Steam
# IME
winget install -e --id Rime.Weasel # 小狼毫 Rime
# Misc
winget install -e --id 9N5LW3JBCXKF --source msstore # MSIX Packaging Tool
winget install -e --id 9PKTQ5699M62 --source msstore # iCloud
winget install -e --id RazerInc.RazerInstaller # Razer Synapse
# Social
winget install -e --id 9N97ZCKPD60Q --source msstore # Unigram (Telegram client)
winget install -e --id Tencent.QQ.NT
winget install -e --id XPFCKBRNFZQ62G --source msstore # WeChat in Windows Store (MSIX)
# Others
winget install -e --id Appest.TickTick
winget install -e --id 9NBLGGH4Z1SP --source msstore # ShareX (screen capture)
# Fonts
scoop install FiraCode-NF
scoop install CascadiaCode-NF
scoop install LXGWWenKai # 霞鹜文楷
scoop install LXGWWenKaiMono # 霞鹜文楷Mono
# WSL
scoop install archwsl
wsl --set-version Arch 1