Skip to content

My Windows Dotfiles managed with Chezmoi

Notifications You must be signed in to change notification settings

KevinNitroG/windows-dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KEVINNITRO WINDOWS DOTFILES

GitHub last commit (by committer) GitHub repo size

Important

Please just use this as reference. My installation may not work (because I haven't tested yet). Just go and grab the config you like.



😎 PREVIEW

Terminal

Terminal Preview

Check Wifi Password

SELECT SHOWN
Check Wifi Password 1 Check Wifi Password 2

Note

Using FZF if installed. Work even without FZF but I'm lazy to show.


App Manage

PM UPGRADE UNINSTALL
SCOOP Scoop upgrade Scoop uninstall
CHOCO Choco upgrade Choco uninstall

Note

Manage via Package Managers (Scoop isn't PM btw :v)

Important

Need FZF


Find files / directories / file content

fzf fd
fdg - find files fdg - find directories
ripgrep fzf
rgg - ripgrep rgg - ripgrep - fzf

cd or neovim

Note

These come from fzf advanced integration but in Powershell

The config is in Documents/PowerShell/Scripts/kevinnitro/fzf.ps1

  • Bonus: yazi and cd yzcd

Neovim

Neovim


πŸͺ΄ INSTALL

1️⃣ Add Keys

  • SSH (Admin)
    Set-Service ssh-agent -StartupType Automatic
    Start-Service ssh-agent
    ssh-add "$env:USERPROFILE/.ssh/id_ed25519"
  • Import GPG Keys (use builtin GPG from git):
    git bash
    gpg --import public.gpg
    gpg --import secret.gpg
    gpg --edit-key KevinNitroG
    trust
    5
    y
    quit

In order to encrypt / decrypt chezmoi


2️⃣ Install prerequisite

  • Set execution policy to run script from URL (non-admin)
    Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
  • Install perquisite scoop (non-admin)
    iwr "https://raw.githubusercontent.com/KevinNitroG/windows-dotfiles/main/dot_install/prerequisiteScoop.ps1" | iex
  • Install perquisite choco (admin)
    iwr "https://raw.githubusercontent.com/KevinNitroG/windows-dotfiles/main/dot_install/prerequisiteChoco.ps1" | iex

3️⃣ Chezmoi

Important

Use powershell IDE (not pwsh also), don't use Windows Terminal.

Run with Administrator

chezmoi init --apply --verbose git@github.com:KevinNitroG/windows-dotfiles.git

Follow instruction of chezmoi to setup chezmoi config


4️⃣ Set env path (Admin)

iwr "https://raw.githubusercontent.com/KevinNitroG/windows-dotfiles/main/dot_install/environmentVariables.ps1" | iex

5️⃣ Install software

  • Install programming languages
    iwr "https://raw.githubusercontent.com/KevinNitroG/windows-dotfiles/main/dot_install/programmingLanguage.ps1" | iex
  • Install software (non-admin)
    iwr "https://raw.githubusercontent.com/KevinNitroG/windows-dotfiles/main/dot_install/softwares-nonadmin.ps1" | iex
  • Install software (admin)
    iwr "https://raw.githubusercontent.com/KevinNitroG/windows-dotfiles/main/dot_install/softwares-admin.ps1" | iex

6️⃣ Install fonts


7️⃣ Install some code stuff via Mason manually

DAP

  • codelldb / cpptools
  • debugpy
  • js-debug-adapter

Linter

  • actionlint
  • cpplint
  • markdownlint
  • ruff

Formatter

  • markdown-toc
  • markdownlint
  • prettier
  • ruff
  • shfmt
  • stylua

8️⃣ Install Nvim

  • :TSInstall powershell
  • :MasonInstall powershell-editor-services

πŸ§ͺ ONE SCRIPT (test)

Note

This script merges above steps. But haven't been tested yet. Go import SSH and GPG keys first.

It may not work =))

  • Set execution policy to run script from URL (non-admin)
    Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
  • Run script (non-admin)
    iwr "https://raw.githubusercontent.com/KevinNitroG/windows-dotfiles/main/dot_install/install.ps1" | iex

🎈 EXTRAS

Crack Winrar (Admin)

curl https://gist.githubusercontent.com/MuhammadSaim/de84d1ca59952cf1efaa8c061aab81a1/raw/rarreg.key | Out-File -FilePath "C:\Program Files\WinRAR\rarreg.key" -Force

Source


Patch IDM

Repack.me

Note

Password is inside the archived file

PITVN

Old method

  • Patch script
    iex(irm is.gd/idm_reset)
  • Disable check for update
    • HKEY_CURRENT_USER\Software\DownloadManager
    • CheckUpdtVm: 10 ->0
  • Block host (admin)
    v "C:\Windows\System32\drivers\etc\hosts"
    +  127.0.0.1           tonec.com
    +  127.0.0.1           www.tonec.com
    +  127.0.0.1           registeridm.com
    +  127.0.0.1           www.registeridm.com
    +  127.0.0.1           secure.registeridm.com
    +  127.0.0.1           internetdownloadmanager.com
    +  127.0.0.1           www.internetdownloadmanager.com
    +  127.0.0.1           secure.internetdownloadmanager.com
    +  127.0.0.1           mirror.internetdownloadmanager.com
    +  127.0.0.1           mirror2.internetdownloadmanager.com
    +  127.0.0.1           mirror3.internetdownloadmanager.com

Install & Active Office

  • Install: OTP Ladian

  • Active

    irm https://massgrave.dev/get | iex

Spotify

  • SpotX
    # main
    iex "& { $(iwr -useb 'https://raw.githubusercontent.com/SpotX-Official/spotx-official.github.io/main/run.ps1') } -new_theme"
    # mirror
    iex "& { $(iwr -useb 'https://spotx-official.github.io/run.ps1') } -m -new_theme"

Chrome extensions

Note

Those are extensions which aren't in webstore and have to be installed manually.


Need to do

  • Change ownership of old folders / files
  • Install Cursor
  • Change Downloads, Desktop,... location
  • Symlink git folder (admin)
    New-Item -Path gits -ItemType SymbolicLink -Value E:\Git-Repo
  • Restore Powertoys settings
  • Winaero-tweaker
    • Disable Windows Defender
    • Disable Shortcut Arrow
  • VisualCppRedist AIO
  • EVKey / Unikey
  • Wakatime CLI (Required by Terminal Powershell): pip install wakatime
  • Wakatime for Office
  • Chrome flags
  • MathType
  • Spotify
    v $env:USERPROFILE\AppData\Roaming\Spotify\prefs
    +storage.size=500
  • Windows Settings
  • Make Windows to use UTC time in order to dual boot with Linux
    reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_DWORD /f

Others


πŸ“’ NOTES

Just something that I often forget

SSH

  • IDA_RSA public key
    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDap/5GnLxYYNJ2QB1rYRgXyHLQud0L3Y6sfiPL6iAdqZRm+f+006DeZtJ4oP2IN8oS6nF6tfWhCaQ91jv3fZWO+olhyBZulSGbb75WdcqLcctfDwc9er+BZZZMBsF0inEbCgHEooo5kelkuuPIEUmeqn9ozUtQ4A6mLIurjsGfy2nD2bCjYys3UxUa09xEiQxvgHnlvSPCh9XvG1h4eX611GI6EbtJoOvzFPYzaxdNosbombq1HMnNGXk3TMS9fghE1GjnMiBbrortGn6mT0aNi//N9Wgr9AYR0dY2BWk1CZXF78G4MWZoaLOLW5sriMjU881UbfmJx6MmvMAEHDrfJDIQAIoRsjAJbw00SoZjspEg3R8f8ekNjduzikG65noMJGd+jTD7MtBDe+YNCuZp6UQAPwbPQLtlbKOysEWzPupKMHIsPkzUJpdYp1ML1ljV/q+FLRKje4FvWUKTk8KekWxp2tUyn5gWUIrG7DGkE5MKpBp0njFJ17n8H81xQJs= [email protected]
    
  • ID_ED25519 public key
    ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGmsTFqYpEvaJbMm6PSN2pH4JY0Whrd1F3jkP9OCcrWF [email protected]
    

GPG

  • Export keys
    # Public key
    gpg --output kevinnitro-public-gpg-key.pgp --armor --export trannguyenthaibinh46@gmail.com
    # Secret key
    gpg --output kevinnitro-secret-gpg-key.pgp --armor --export-secret-key trannguyenthaibinh46@gmail.com
  • Import (for both public and secret keys)
    gpg --import the-key.gpg
  • Start GPG agent (set a task schedule to trigger on log on)
    gpgconf --launch gpg-agent
  • May want to trust a key
    gpg --edit-key {key-id}
    trust
    5
    quit
  • Start gpg-agent and keyboxd for signing commit (with task scheduler!)
    gpgconf --launch gpg-agent
    gpgconf --launch keyboxd

Note

Remove output params to export out stdout

Ref: https://unix.stackexchange.com/a/482559

Browser

Fix Brave profile installed via Scoop

  • Open registry
  • Goto:
    Computer\HKEY_CURRENT_USER\Software\Classes\BraveFile\shell\open\command
    Computer\HKEY_CURRENT_USER\Software\Classes\BraveHTML.{...}\shell\open\command
    
  • Change: "C:\Users\{user}\scoop\apps\brave\current\brave.exe" --user-data-dir="C:\Users\{user}\scoop\apps\brave\current\User Data" --single-argument %1

Pwsh via Scoop

C:\Users\kevinnitro\scoop\apps\pwsh\current\install-file-context.reg
C:\Users\kevinnitro\scoop\apps\pwsh\current\install-explorer-context.reg

Windows

Set / Get variables

  • View system variables
    [System.Environment]::GetEnvironmentVariable($KEY, [System.EnvironmentVariableTarget]::Machine)
  • View user variables
    [System.Environment]::GetEnvironmentVariable($KEY, [System.EnvironmentVariableTarget]::User)
  • Set system variables
    [System.Environment]::SetEnvironmentVariable($KEY, $VALUE, [System.EnvironmentVariableTarget]::Machine)
  • Set user variables
    [System.Environment]::SetEnvironmentVariable($KEY, $VALUE, [System.EnvironmentVariableTarget]::User)

Default variables

VARIABLE PATH
APPDATA C:\Users\kevinnitro\AppData\Roaming
HOMEDRIVE C:
USERPROFILE C:\Users\kevinnitro
HOMEPATH \Users\kevinnitro
LOCALAPPDATA C:\Users\kevinnitro\AppData\Local
PROGRAMDATA C:\ProgramData
PROGRAMFILES C:\Program Files
PROGRAMFILES(X86) C:\Program Files (x86)
SYSTEMROOT C:\Windows
TEMP & TMP C:\Users\kevinnitro\AppData\Local\Temp
USERDOMAIN DESKTOP-7QJ8Q7V
USERNAME kevinnitro
WINDIR C:\Windows

Source

More reference: Complete List of Environment Variables in Windows 10

Optimise VHD(X)

diskpart
select vdisk file="D:\file.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
exit

[!NOTE] > microsoft/WSL#4699 (comment)

Ensure disk is detached

Others