# 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 init`
or:
Clone an existing dotfiles repository: `mycfg clone github:pjones123`
- 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>`
### 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>`
## 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:
```yaml
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](https://github.com/pjones123/dotfiles)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
资源分类:Python库 所属语言:Python 资源全名:mycfg-1.1.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
mycfg-1.1.0.tar.gz (27个子文件)
mycfg-1.1.0
MANIFEST.in 24B
PKG-INFO 3KB
mycfg.egg-info
PKG-INFO 3KB
requires.txt 16B
SOURCES.txt 466B
entry_points.txt 47B
top_level.txt 6B
dependency_links.txt 1B
LICENCE 35KB
setup.cfg 38B
mycfg
main.py 243B
const.py 873B
parser.py 991B
cli.py 5KB
obj
unit.py 3KB
group.py 716B
__init__.py 39B
environment.py 360B
meta.py 737B
lib.py 4KB
__main__.py 51B
state.py 142B
__init__.py 20B
error.py 288B
requirements.txt 15B
setup.py 1KB
README.md 3KB
共 27 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功