Dotfiles are configuration files that are used to customize the behavior of various command-line tools and applications. They are commonly used by developers and power users to streamline their workflow and make their environment more efficient. This guide provides instructions for installing and using dotfiles on Windows 11.
- Installation
- Commands
- Chocolatey
- PowerShell
- Customization
- Troubleshooting
- Resources
Tip: You are advised to execute this from windows powershell app and not from windows Terminal app
Set execution policy
Dubious ownership
(irm -useb https://get.chezmoi.io/ps1) | powershell -c -
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
choco install chezmoi -y
chezmoi init https://github.com/cuberhaus/WinDotfiles.git
chezmoi apply
cd .local\share\chezmoi
choco install git -y
git config --global safe.directory '*'
Set-ExecutionPolicy unrestricted
.\home\dot_local\scripts\windows.ps1
To install the dotfiles on Windows 11, follow these steps:
- Set the execution policy in PowerShell by running the following command:
Set-ExecutionPolicy unrestricted
This allows you to run scripts on your system.
-
Clone the dotfiles repository by following chezmoi installation
-
Configure Git to ignore file ownership by running the following command:
git config --global safe.directory '*'
This prevents Git from detecting "dubious ownership" issues when you commit changes to the repository.
- Run the installation script by running the following command:
.\bin\windows.ps1
This installs the dotfiles and their associated dependencies on your system.
- Install Chezmoi
You can install Chezmoi by running the following command in PowerShell:
sh -c "$(curl -fsLS get.chezmoi.io)"
This downloads and installs Chezmoi on your system.
- Initialize Chezmoi
Run the following command to initialize Chezmoi:
chezmoi init https://github.com/cuberhaus/WinDotfiles.git
This initializes Chezmoi with the WinDotfiles repository.
- Apply dotfiles
To apply the dotfiles, run the following command:
chezmoi apply
This applies the dotfiles to your system.
- Customize dotfiles
You can customize the dotfiles by editing the files in the ~/.local/share/chezmoi
directory. Changes you make will be tracked by Chezmoi and can be pushed to the WinDotfiles repository.
Chezmoi supports several source state attributes that can be used to customize how files are managed. You can learn more about these attributes in the Chezmoi reference.
- Commit and push changes
When you have made changes to the dotfiles, you can commit and push them to the WinDotfiles repository using the following commands:
chezmoi git add <file>
chezmoi git commit -m "Updated dotfile"
chezmoi git push
This commits and pushes your changes to the WinDotfiles repository.
- Upgrade Chezmoi
To upgrade Chezmoi to the latest version, run the following command:
chezmoi upgrade
- Make changes to repo from home
All changes made to the files in home will be updated in the repo with the following command:
chezmoi re-add
This downloads and installs the latest version of Chezmoi on your system.
To view a list of available commands, run the following command:
aliases
Chocolatey is a package manager for Windows that is used to install and manage software packages. To use Chocolatey with the dotfiles, follow these steps:
To upgrade all installed packages, run the following command:
choco upgrade all
This updates all packages to their latest versions.
To list all locally installed packages, run the following command:
choco list --local-only
This displays a list of all packages that are currently installed on your system.
PowerShell is a command-line shell and scripting language that is used to automate tasks and manage system configurations. To customize your PowerShell environment with the dotfiles, follow these steps:
- Locate your PowerShell profile directory by running the following command:
$PROFILE | Format-List -Force
This displays the location of your PowerShell profile directory.
To add a task at login, use task scheduler
If user and computer name are different you will have to change that in the task scheduler through the GUI
tip: do not use the GUI
Important command:
c:\windows is where your healthy windows is (it just does not have the EFI entry to boot into it) v: is where the EFI installation will go
bcdboot c:\windows /s v: /f UEFI