Skip to main content

dot.py is a minimalist python script for managing dotfiles via symbolic links.

Project description

dot.py

dot.py is a minimalist 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+.

Install

Simply clone the repository.

git clone https://github.com/vincentqb/dot.py ~/dot.py

Quick Start

  1. Create your initial profile. For example, we create a directory called default.

    mkdir default
    
  2. Add any files you would like linked into your home when this profile is linked.

    echo 'set -o vi' > default/env
    
  3. Link the profile. When you link, dot.py prepends a dot, in front of the original file name, to the linked file. Below, default/env will be linked to ~/.env.

    ~/dot.py/dot.py link default
    
  4. Continue adding your dotfiles to the default profile.

    mv ~/.bashrc default/bashrc
    
  5. You can safely re-run the link command 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.

  1. Append .template to any files which should be rendered. For example, assume you have a file default/env.template containing:

    export SECRET_KEY=$ENV_SECRET_KEY
    
  2. 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 value ENV_SECRET_KEY when linking the default profile:

    env ENV_SECRET_KEY=test1234 ~/dot.py/dot.py link default
    
  3. 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 file default/env.rendered being created and linked to ~/.env with the below contents.

    export SECRET_KEY=test1234
    
  4. Be sure to include **/*.rendered in .gitignore if you put your dotfiles into a git repository.

Testing

Run tests with python3 -m pytest from the root of the repository.

Test and Build

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

dot_py-1.0.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

dot_py-1.0.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file dot_py-1.0.0.tar.gz.

File metadata

  • Download URL: dot_py-1.0.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for dot_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 35196bcc263305d29b83367f8763fd9d433f66d78c2866b5359bae65c48139f6
MD5 5eff36b8b98013a295e5837c221bb3f1
BLAKE2b-256 262d23950631b5a232e53b46ce8b6d3bd97285ac5024b92e7533f8a7ecaa15bd

See more details on using hashes here.

File details

Details for the file dot_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dot_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for dot_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ee50c79166da783a3dcb632106be2eaef7e79ee68f7c822bcb2aa9094824e5a
MD5 8a9075c8684c559f1e6884b20671d1e1
BLAKE2b-256 935fe13031c90f49745cd04d3db2eeb489ce75cce8c2ca44e55546ab412a983c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page