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

Uploaded Source

Built Distribution

dot_py-1.5.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

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

Hashes for dot_py-1.5.0.tar.gz
Algorithm Hash digest
SHA256 788b922f0d5c0a8a69850fa0854510f35646aea7ad51b68442b0eddc35b77b25
MD5 0c991457b8916154fe0abe0b1bfd1b65
BLAKE2b-256 573a2958e7b83bacabfda3960df8ee1fb62c1a8c2066bffeb2c4836bd4b78d7c

See more details on using hashes here.

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

Hashes for dot_py-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad05b333b2078e43236d12cf728d42e952870638b2bf3573824a2540de264adc
MD5 73eaa147506bced9ec5169a6ca21decc
BLAKE2b-256 fb46faf213ce2549672c0759c3b8781c10e4293feb2d79b221da1ed24321f3b9

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