Manage all your configuration files with different profiles remotely.
Made with ❤️ by Jorge Bodega and Perseo Gutierrez
Dotpyle is a Python implementation of a dotfile system manager, allowing users to keep a secure copy of all program configurations remotely, create different profiles, etc.
pip install dotpyle
If autocomplete is wish to be enabled:
bash $(pip show dotpyle | grep Location | cut -f2 -d':')/dotpyle/autocomplete-install.sh
This will request a git url and a git token If it is the first time you use Dotpyle, you will need to create an empty repo on GitHub, GitLab, etc.
If you want to manage an existing repo you just need to input url and token
dotpyle init [--url <git url>] [--protocol (git/https)] [--token (if repo is private)]
dotpyle edit config
Open dotpyle.yml
file in your default editor for edit.
Any change made here will be directly translated into your system.
Understand this file as a reactive file. Anything you edit, it will be reflected in your system.
TODO: give more examples
A file correctness will be done before saving changes and performing proper actions.
dotpyle edit local
Open dotpyle.local.yml
file in your default editor for edit.
Any change made here will be traduced in linking or unlinking dotfiles in your system.
A file correctness will be done before saving changes and performing proper actions.
This is a quick way to define your local configuration (which programs and which profile will be linked to your system for that program)
See link and unlink commands for a CLI approach.
dotpyle edit readme
Open your dotfiles README.md file in your default editor for edit. If it does not exist, it will create it from a template (referencing this project, it's up to you to support us :3)
- Copy file to repo location
- Delete file of path
- Generate symbolic link to path
Examples:
- Create program_name key
- Create profile (default by default)
- Set root and paths (optionally pre and post hooks)
dotpyle add dotfile <program_name> [--profile <profile_name>] [--root
<root_path>] [--path <dotfile_path1> [--path dotfile_path2>] ...] [--pre
<pre_config_install_command> [--pre <...>]] [--post
<post_config_install_command> [--post <...>]]
dotpyle list [--name <program_name>] [--profile <profile_name>]
dotpyle install <program_name> [--profile <profile_name>]
User may avoid interacting directly with Dotpyle git repository
TODO: Considering only one dotpyle sync command for pulling && pussing
This command will fetch new changes from the remote repository and check nothing will break
TODO
dotpyle pull
dotpyle push
Commiting should be as granular and personal as possible so Dotpyle offers the granularity you may need.
dotpyle commit [-n <program_name> [--path=<path1> --path=<path2> ...]] [-p <profile_name>] -m <commit_message>
Examples:
-
General commit for all changes on all programs and profiles installed and managed by Dotpyle:
dotpyle commit -m 'fix typo on vimrc'
-
Commit for all dotfiles of specific program (e.g. nvim):
dotpyle commit -n nvim -m 'commit message'
-
Commit for all programs (and all configuration files) of a concrete profile (e.g. work):
dotpyle commit -p work -m 'commit message'
-
Commit for specific program and specific dotfiles of that program for all profiles: (e.g. alacritty base configuration for all profiles which have alacritty)
dotpyle commit -n alacritty --path=alacritty.yml -m 'commit message'
-
Commit for specific program and specific dotfiles of that program on specific profile: (e.g. i3 configuration for i3-resurrect and status bar on home profile)
dotpyle commit -n i3 --path=i3-resurrect/config.json --path=i3status.conf -p home -m 'commit message'
dotpyle profile create <profile_name>
Creates a new profile named <profile_name>
, if it does not exist.
dotpyle profile list [<profile_name>]
dotpyle profile change <profile_name> [<program_name> ...]
This option will change the configuration file to the <profile_name>
passed for:
- all dotfiles if no
<program_name>
is passed - all
<program_name>
's passed
Example:
dotpyle profile change work nvim git
Neovim work profile and Git work profile will be symlinked to its corresponding path.
dotpyle profile change home
All dotfiles which have a 'home' profile will be symlinked to its corresponding paths. Dotfiles which does not have a configuration for given profile will not be altered.
TBD
Structure of yml (every thing inside [] are examples)
# General settings for dotpyle
settings:
# Defined profiles
profiles:
- default
- [home]
- [work]
# TODO
TBD
dotfiles:
# Top level key, the name of the program for which store config files
[program_name]:
# Name of the profile (default profile: default)
[profile_name]:
# Bash commands to be executed before configuring 'profile_name'
before:
- [bash script 1]
- [bash script 2]
# Bash commands to be executed after configuring 'profile_name'
after:
- [bash script 1]
- [bash script 2]
# Base path for start storing 'paths' for 'program_name' (default $HOME)
root: ~
# Configuration files for 'program_name'. Subroutes will be created if they dont exist
paths:
- [.configuration] # will symlink dotfiles/program_name/profile_name/.configuration => $HOME/.configuration
- [subroute/.filerc] # will symlink dotfiles/program_name/profile_name/subroute/.filerc => $HOME/subroute/.filerc
- [subroute0/subroute1/filerc] # will symlink dotfiles/program_name/profile_name/subroute0/subroute1/filerc => $HOME/subroute0/subroute1/filerc
Example of dotpyle.yml config file:
settings:
profiles:
- default
- windows
dotfiles:
git:
default:
before:
- sudo pacman -S git
paths:
- .gitconfig
windows:
before:
- choco install git.install
root: C:\Users\usr
paths:
- .gitconfig
nvim:
default:
before:
- sudo pacman -S neovim node
root: ~/.config/nvim
paths:
- init.vim
- after/ftplugin/ada.vim
windows:
before:
- choco install neovim --pre
root: C:\AppData\Local\nvim
paths:
- init.vim
- after/ftplugin/ada.vim
This will be the generated file structure on the repository:
dotfiles
|
|-> git
| |-> default
| | |-> .gitconfig
| |-> windows
| |-> .gitconfig
|
|-> nvim
|-> default
| |-> init.vim
| |-> after
| |-> ftplugin
| |-> ada.vim
|
|-> windows
|-> init.vim
|-> after
|-> ftplugin
|-> ada.vim
Dotpyle needs to create a local configuration file in order to keep track of your configuration on the current machine.
This file will not be tracked by git so non conflicts will be derived when using Dotpyle on multiple computers.
Also, this file will be generated automatically by Dotpyle on 'init' command or whenever Dotpyle can't find it.
Structure of yml (every thing inside [] are examples)
installed:
[program_name]:
profile: [profile_name]
# modified: [True|False]
TBD
TBD
- Decorator / global variable to instance parser and handlers
- Print centralized service with colorful error / warning / correct output
- Change uninstall name for on more intuitive
- Run command to execute alone hooks
- Create commit on uninstall dotfile
- Force option on link command