|
1 | 1 | # dots |
2 | 2 |
|
3 | | -`dots` is yet another dotfiles management tool. |
| 3 | +Yet another dotfiles management tool. |
4 | 4 |
|
5 | | -TODO: badges, plenty of them! |
| 5 | +## :sparkles: Features |
6 | 6 |
|
7 | | -## Features |
| 7 | +- :link: Dotfiles stored in a central folder and symlinked to their real location |
| 8 | +- :repeat: Automatic git versioning on every change |
| 9 | +- :computer: Per-machine configuration via hostname-based config sections |
| 10 | +- :warning: Conflict detection and resolution during sync |
8 | 11 |
|
9 | | -- dotfiles stored in a central folder and symlinked by `dots` to their real location |
10 | | -- handles versioning, Git knowledge should not be required to use `dots` |
11 | | -- can store multiple machines configuration (one branch per machine, named after its hostname) |
12 | | -- private files (SSH keys, configuration files containing credentials, etc.) can be stored encrypted |
| 12 | +## :clipboard: Requirements |
13 | 13 |
|
14 | | -## Dependencies |
| 14 | +- Python 3.12+ |
| 15 | +- git |
15 | 16 |
|
16 | | -TODO |
| 17 | +## :package: Installation |
17 | 18 |
|
18 | | -## Installation |
| 19 | +Clone the repository and install with [uv](https://docs.astral.sh/uv/): |
19 | 20 |
|
20 | | -TODO |
| 21 | +```bash |
| 22 | +git clone https://github.com/mdeous/dots.git |
| 23 | +cd dots |
| 24 | +uv sync |
| 25 | +``` |
21 | 26 |
|
22 | | -## Configuration |
| 27 | +Or with pip: |
23 | 28 |
|
24 | | -The `dots` configuration file should be located at `${HOME}/.dots.conf`, and is organized in sections |
25 | | -in the same way as a `.ini` file. The configuration file can handle settings for multiple machines, so |
26 | | -that it also can be synced (by default, `dots` automatically adds its configuration when the repo is |
27 | | -initialized). |
| 29 | +```bash |
| 30 | +git clone https://github.com/mdeous/dots.git |
| 31 | +cd dots |
| 32 | +pip install . |
| 33 | +``` |
28 | 34 |
|
29 | | -The global section is `DEFAULT` (case-sensitive), which holds default values that can be overriden for in |
30 | | -the other sections. Each machine settings are stored in a separate section named after the machine hostname. |
| 35 | +## :gear: Configuration |
31 | 36 |
|
32 | | -The values that can be used in each sections are : |
| 37 | +The configuration file should be located at `~/.dots.conf`. |
33 | 38 |
|
34 | | -- `repo_dir` : custom repository path (default: `~/dots`) |
35 | | -- `gpg_key_id` : ID of the GPG key to use for file encryption (default: none) |
36 | | -- `ignored_files` : comma-separated list of files that should'nt be synced |
| 39 | +Settings are organized in sections named after the machine's hostname. The `[DEFAULT]` section provides fallback values used when no hostname-specific section exists. |
37 | 40 |
|
38 | | -An example configuration can be found in the `sample-config.conf` file located in the same folder as this |
39 | | -README. |
| 41 | +### Available settings |
40 | 42 |
|
41 | | -## Usage |
| 43 | +| Key | Description | Default | |
| 44 | +| --------------- | --------------------------------------------------------- | -------- | |
| 45 | +| `repo_dir` | Path to the dotfiles repository | `~/dots` | |
| 46 | +| `gpg_key_id` | GPG key ID for file encryption | _none_ | |
| 47 | +| `ignored_files` | Comma-separated list of glob patterns to skip during sync | _none_ | |
42 | 48 |
|
43 | | -TODO |
| 49 | +### Example |
44 | 50 |
|
45 | | -## Files layout |
| 51 | +```ini |
| 52 | +[DEFAULT] |
| 53 | +repo_dir = ~/dots |
46 | 54 |
|
47 | | -- `dots` configuration file is `${HOME}/.dots.conf` |
48 | | -- dotfiles are stored in `${HOME}/dots/files` |
49 | | -- encrypted files are stored in `${HOME}/dots/encrypted` |
50 | | -- decrypted files (symlink targets) are not versioned and are stored in `${HOME}/dots/decrypted` |
| 55 | +[work-laptop] |
| 56 | +repo_dir = ~/dotfiles |
| 57 | +ignored_files = .bashrc, .config/personal/* |
51 | 58 |
|
52 | | -## License |
| 59 | +[home-desktop] |
| 60 | +gpg_key_id = ABCDEF1234567890 |
| 61 | +``` |
53 | 62 |
|
54 | | -This project is licensed under the BSD 3-clause license. |
| 63 | +## :rocket: Usage |
| 64 | + |
| 65 | +### Global options |
| 66 | + |
| 67 | +```text |
| 68 | +dots [--config PATH] [--verbose] [--version] COMMAND |
| 69 | +``` |
| 70 | + |
| 71 | +| Option | Short | Description | |
| 72 | +| ----------- | ----- | --------------------------------------------- | |
| 73 | +| `--config` | `-c` | Path to config file (default: `~/.dots.conf`) | |
| 74 | +| `--verbose` | `-v` | Display debug information | |
| 75 | +| `--version` | `-V` | Display version and exit | |
| 76 | + |
| 77 | +### `dots add <file>` |
| 78 | + |
| 79 | +Add a file to the repository. The file is copied into the repo and replaced with a symlink. |
| 80 | + |
| 81 | +```bash |
| 82 | +dots add ~/.bashrc |
| 83 | +dots add ~/.config/git/config |
| 84 | +``` |
| 85 | + |
| 86 | +### `dots remove <file>` |
| 87 | + |
| 88 | +Remove a file from the repository. The symlink is replaced with the original file. |
| 89 | + |
| 90 | +```bash |
| 91 | +dots remove ~/.bashrc |
| 92 | +``` |
| 93 | + |
| 94 | +### `dots list` |
| 95 | + |
| 96 | +List all files in the repository and their sync status. |
| 97 | + |
| 98 | +```bash |
| 99 | +dots list |
| 100 | +``` |
| 101 | + |
| 102 | +### `dots sync` |
| 103 | + |
| 104 | +Synchronize the repository with the filesystem. Creates missing symlinks and detects conflicts. |
| 105 | + |
| 106 | +```bash |
| 107 | +dots sync |
| 108 | +``` |
| 109 | + |
| 110 | +| Option | Short | Description | |
| 111 | +| ---------------- | ----- | ---------------------------------------------- | |
| 112 | +| `--force-relink` | `-r` | Overwrite links that point to the wrong target | |
| 113 | +| `--force-add` | `-a` | Overwrite the repo version with the local file | |
| 114 | +| `--force-link` | `-l` | Overwrite the local file with the repo version | |
| 115 | + |
| 116 | +`--force-add` and `--force-link` are mutually exclusive. Without force flags, `dots` prompts interactively when conflicts are found. |
| 117 | + |
| 118 | +## :scroll: License |
| 119 | + |
| 120 | +BSD 3-Clause. See [LICENSE](LICENSE) for details. |
0 commit comments