My personal dotfiles.
This repository manages my personal configuration files (dotfiles).
Running the setup.py script will automatically deploy these configuration files to your home directory by creating symbolic links.
The setup.py script deploys configuration files from the dotfiles.d directory to your home directory (~/) as symbolic links.
Here's how it works:
- Creates Symbolic Links:
- It creates symbolic links from each configuration file in
dotfiles.dto the corresponding location in your home directory.
- It creates symbolic links from each configuration file in
- Backs Up Existing Files:
- If a file or directory with the same name already exists at the destination, it will be backed up with a
.bakextension before the symlink is created. - For example, an existing
~/.vimrcwill be renamed to~/.vimrc.bak.
- If a file or directory with the same name already exists at the destination, it will be backed up with a
- Overwrites Existing Symlinks:
- If a symbolic link already exists at the destination, it will be removed and a new one will be created.
The script processes files based on the following rules:
- Files ending in
.rcdirectly underdotfiles.d/(e.g.,.vimrc,.zshrc). - The
dotfiles.d/.gitconfigfile. - Any file named
main.*inside a directory ending with.dwithindotfiles.d/(e.g.,.config.d).- In this case, the symbolic link is created with the
.dsuffix removed from the directory name. - For example,
dotfiles.d/.config.d/main.vimwill be linked as~/.config.
- In this case, the symbolic link is created with the
Run the following command to deploy the dotfiles automatically.
$ ./setup.pyYou can add your own configuration files to the dotfiles.d/ directory and run setup.py to manage them.
- Add your configuration file to the
dotfiles.d/directory.dotfiles └── dotfiles.d └── .my_custom_rc <-- Add this file - Run the script.
$ ./setup.py
- A symbolic link will be created at
~/.my_custom_rc.
The setup.py script gives special treatment to directories ending in .d within dotfiles.d/.
- Create a directory like
.config.dinsidedotfiles.d/. - Place your main configuration file, named starting with
main(e.g.,main.conf), inside it.dotfiles └── dotfiles.d └── .config.d <-- Create this directory └── main.conf <-- This is the main config file - Run the script.
$ ./setup.py
- A symbolic link to
dotfiles.d/.config.d/main.confwill be created as~/.config.