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 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

  1. Install and run with dot.py below

    pip install dot.py
    

    or download the script directly and run with ~/dot.py below

    wget https://raw.githubusercontent.com/vincentqb/dot.py/main/dot.py -O ~/dot.py && chmod u+x ~/dot.py
    
  2. Create your initial profile. For example, you can create a directory called default.

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

    mv ~/.bashrc default/bashrc
    
  4. 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
    
  5. 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.

  1. Append .template to any files which should be rendered. For example, assume you have a file default/bashrc.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 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/bashrc.rendered being created and linked to ~/.bashrc with the below contents.

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

Development

For linting, building and testing, see the workflow.

Test

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.4.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

dot_py-1.4.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dot_py-1.4.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for dot_py-1.4.0.tar.gz
Algorithm Hash digest
SHA256 d619956d98df8a12a15a3c43045de08b1c83648e3c2633c8810a184a8b209f55
MD5 ef1446a7d6ac4622608e4f194d05849d
BLAKE2b-256 0a23f93510b69183f3724dafb3db45f0e2708afcd1149798311e3458558f89ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dot_py-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for dot_py-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7eae7f19a0a154fbeaa4443fa2130e9fa2c5f42e7a048ee56fa936e4cc9fad8d
MD5 7a9ff6cd4a26681f453834a05252a4d4
BLAKE2b-256 d315204c3b26580d3936bef547b19eb2985f872d77d58a987191eb658f77b69b

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