dot.py is a minimalist python script for managing dotfiles via symbolic links.
Project description
dot.py
dot.py is a minimalist one-file python script for managing dotfiles via symbolic links. Inspired by bashdot, it supports multiple profiles and customizable file templates with variables. No external dependencies, just python 3.6+.
Quick Start
-
Install and run with
dot.py
belowpip install dot.py
or download the script directly and run with
~/dot.py
belowwget https://raw.githubusercontent.com/vincentqb/dot.py/main/dot.py -O ~/dot.py && chmod u+x ~/dot.py
-
Create your initial profile. For example, you can create a directory called
default
.mkdir default
-
Add any files you would like linked into your home when this profile is linked.
mv ~/.bashrc default/bashrc
-
Link the profile. When you link, dot.py prepends a dot, in front of the original file name, to the linked file. Below,
default/bashrc
will be linked to~/.bashrc
.dot.py link default
-
You can safely re-run to link newly added files. Store this profile in a cloud drive or source control. Repeat for additional profiles.
Templates
Values which need to be set in a file when dot.py is run can be placed in a template.
-
Append
.template
to any files which should be rendered. For example, assume you have a filedefault/bashrc.template
containing:export SECRET_KEY=$ENV_SECRET_KEY
-
The rendered files will be created in the same directory, and have
.template
replaced with.rendered
. In the example, you can run the following to set the valueENV_SECRET_KEY
when linking the default profile.env ENV_SECRET_KEY=test1234 dot.py link default
-
The rendered file will be linked into the home with the
.rendered
suffix removed and a dot prepended. In the example, this will result in the rendered filedefault/bashrc.rendered
being created and linked to~/.bashrc
with the below contents.export SECRET_KEY=test1234
-
Be sure to include
**/*.rendered
in.gitignore
if you put your dotfiles into a git repository.
Development
For linting, building and testing, see the workflow.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dot_py-1.5.0.tar.gz
.
File metadata
- Download URL: dot_py-1.5.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 788b922f0d5c0a8a69850fa0854510f35646aea7ad51b68442b0eddc35b77b25 |
|
MD5 | 0c991457b8916154fe0abe0b1bfd1b65 |
|
BLAKE2b-256 | 573a2958e7b83bacabfda3960df8ee1fb62c1a8c2066bffeb2c4836bd4b78d7c |
File details
Details for the file dot_py-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: dot_py-1.5.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad05b333b2078e43236d12cf728d42e952870638b2bf3573824a2540de264adc |
|
MD5 | 73eaa147506bced9ec5169a6ca21decc |
|
BLAKE2b-256 | fb46faf213ce2549672c0759c3b8781c10e4293feb2d79b221da1ed24321f3b9 |