A basic dotfiles manager
Project description
MyCfg - A basic dotfiles manager.
MyCfg is very simple and has few features compared with many other dotfile managers. It is designed for my specific use-case.
Installation:
python3 -m pip install mycfg
Usage:
Setup:
-
Initialise a dotfiles repository:
mycfg initor: Clone an existing dotfiles repository:mycfg clone github:pjones123ormycfg clone https://github.com/pjones123/dotfiles -
Enter your dotfiles directory:
mycfg cd -
Customise your config by editing
config.yml -
Set the environment for your current system:
mycfg set-env <environment> -
Set the package manager for your current system:
mycfg set-pm <package-manager> -
Add additional (backup) package managers:
mycfg add-pm <package-manager>
Load the saved configuration onto your system: mycfg load
Save your system's configuration to the dotfiles repository: mycfg save
Create a new custom script in ~/.config/mycfg/scripts: mycfg mkscript <name>
Any git repositories with at least one remote repository will be saved to the dotfiles repository as a git submodule, and cloned to any new system when loaded
config file:
Your MyCfg configuration exists at ~/.config/mycfg/config.yml
You can enter this directory with mycfg cd
The main objects that can be set in the config file:
- units: These are single, self-contained packages of software.
- groups: These are collections of related units.
- environments: collections of units and groups that make up an entire system environment. Each MyCfg installation can be linked to only one environment.
configuration file format:
units:
zsh:
files:
- .zshrc # file paths are relative to $XDG_HOME
requires-package: list of required packages. Packages are installed according to the packages section.
install-command: command to be run once to install
save-scripts-pre: list of scripts to be run before copying the files, each time a save occurs. Names should be relative to ~/.config/mycfg/scripts
save-scripts-post: same as save-scripts-pre, but run after files are copied
load-scripts-pre: same as save-scripts-pre, but run on load
load-scripts-post: same as load-scripts-post, but run after files are copied
groups:
shell:
units: # list of units for this groups
- zsh
groups:
- groups can require other groups
environments:
desktop: # A complete collection of configurations required for this environments
units:
- can require units
groups:
- and groups
default-package-manager: choose a default package manager for this environment
packages:
zsh:
apt: zsh
pacman: zsh
default: command to run if no package manager matches
package-managers:
pacman:
install: sudo pacman -S
remove: sudo pacman -R
apt:
install: sudo apt install
remove: sudo apt remove
Example:
An example usage can be found in my dotfiles repository
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file mycfg-2.0.1.tar.gz.
File metadata
- Download URL: mycfg-2.0.1.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/4.12.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af9b965b80685d3abf5cc8380dd55a485b675587a18617f9403ded28efcc8e17
|
|
| MD5 |
14561e15218e486107232d00a1184f87
|
|
| BLAKE2b-256 |
09bff15aea1f23d4acfc56ffe6fa75682756684a16c372220837f6e09ab53553
|