You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dotbro is a tool which helps you install and keep your dotfiles up to date.
6
+
*Dotbro* is a tool which helps you install and keep your dotfiles up to date.
7
7
8
8
## tl;dr
9
9
10
-
Create simple [config](#configuration). Run dotbro first time:
10
+
1. Create simple [profile](#profiles).
11
+
12
+
2. Run dotbro first time:
11
13
12
-
dotbro --config path/to/your/config.toml
14
+
dotbro --config path/to/your/dotbro.toml
13
15
14
-
Next time just execute:
16
+
3.Next time just execute:
15
17
16
18
dotbro
17
19
18
-
# Dotfiles? What?
20
+
##Dotfiles? What?
19
21
20
22
Read about dotfiles on [GitHub page](https://dotfiles.github.io/).
21
-
I think [this article](https://medium.com/@webprolific/getting-started-with-dotfiles-43c3602fd789#.h8k6sagzb) by Lars Kappert will give you enough understanding.
23
+
I think [this article](https://webpro.nl/articles/getting-started-with-dotfiles) by *Lars Kappert* will give you enough understanding.
22
24
So, if you don't have your dotfiles repository yet, it's time to create it. Next, read further to explore an easy way to manage your dotfiles.
23
25
24
-
# Motivation
26
+
##Motivation
25
27
26
28
Dotfiles are generally stored in VCS and symlinked from repo directory to your `$HOME` - this is one of the best patterns because you can track changes easily and commit them to your dotfiles repo. However, this pattern does not offer you any way to install your dotfiles, so often people end up writing their own script e.g. in bash, which is not good for long-term purposes (I know that because I had one).
27
29
28
30
This tool was made to deal with dotfiles installation, so you don't waste your time writing your install scripts and focus only on your dotfiles themselves.
29
31
30
-
Dotbro takes on the routine. The main task - installing your dotfiles in one command on any of your machines.
32
+
*Dotbro* takes on the routine. The main task - installing your dotfiles in one command on any of your machines.
31
33
32
-
# Features
34
+
##Features
33
35
34
-
####Simple configuration file
36
+
### Simple Configuration
35
37
36
-
All you need is simple [configuration file](#configuration) in JSON or TOML format.
38
+
All you need is simple [profile](#profiles) in JSON or TOML format.
37
39
38
-
The other benefit is you do not need any special tooling if you use multiple different operation systems, e.g Linux and OS X.
39
-
You can use one single dotfiles repository with multiple dotbro's configuration files inside - one for each OS.
40
+
The extra benefit is that you do not need any special tooling if you use multiple different operation systems, e.g Linux and macOS.
41
+
You can use one single dotfiles repository with multiple dotbro profiles inside - one for each OS.
40
42
What can be easier?
41
43
42
-
#### Clear mapping
44
+
###Explicit Mapping
43
45
44
46
You may want to (or you do already) store your dotfiles in a neat way using named directories like `bash/bashrc`.
45
47
Obviously, you want to symlink it to proper place `$HOME/.bashrc`.
46
48
This is easily done by writing such string in `[mapping]` section:
47
-
```
49
+
50
+
```toml
48
51
"bash/bashrc" = ".bashrc"
49
52
```
50
53
51
-
#### Specify the configuration file only once
54
+
###Smart Profiles
52
55
53
-
First time you run dotbro, specify the config file.
56
+
First time you run dotbro, specify the profile (`dotbro.toml`file you created).
54
57
Dotbro remembers path to this file and use it in further runs.
55
58
56
-
#### Cleans dead symlinks
59
+
###Automatic Cleanup
57
60
58
-
Dotbro cleans broken symlinks in your `$HOME`(or your another destination path).
61
+
Dotbro cleans broken symlinks in your destination path (`$HOME`by default).
59
62
60
-
#### Add command
63
+
###`add` command
61
64
62
65
Dotbro can automate routine of adding files to your dotfiles repo with one single
63
66
command. It does a backup copy, moves the file and creates a symlink to your file.
64
-
After that you only need to add this file to your dotbro config (*I'm working on automation of this*) and commit that file to your repo.
67
+
After that you only need to add this file to your dotbro profile (*I'm working on automation of this*) and commit that file to your repo.
65
68
66
-
#Configuration
69
+
## Installation
67
70
68
-
Configuration can be either TOML or JSON file.
69
-
TOML is peferred, because it's a bit clearer and allows comments.
70
-
However, JSON is good option for configs without mapping, it's short and simple.
71
+
### [Go](https://go.dev/doc/install) toolchain
71
72
72
-
Example of a simple configuration file in TOML format:
This downloads the source code, builds and installs the latest version of dotbro.
76
+
Then you can use `dotbro` command right away.
75
77
76
-
```toml
77
-
# Dotbro configuration file.
78
-
#
79
-
# Some points:
80
-
# - Almost all options have default value.
81
-
# - You can use $ENV_VARIABLE in paths.
78
+
### Arch Linux
82
79
83
-
[directories]
80
+
`dotbro` package is available in AUR:
84
81
85
-
# Directory of your dotfiles repository.
86
-
# Default: directory of this config.
87
-
dotfiles = "$HOME/dotfiles"
82
+
https://aur.archlinux.org/packages/dotbro/
88
83
89
-
# Destination directory - your dotfiles will be linked there.
90
-
# Default: $HOME
91
-
destination = "$HOME"
84
+
### Precompiled binary
92
85
93
-
# Backup directory - your original files will be backuped there.
94
-
# Default: $HOME/.dotfiles~
95
-
backup = "$HOME/.dotfiles~"
86
+
Coming soon ...
96
87
97
-
[mapping]
88
+
## Configuration
98
89
99
-
# Binaries
100
-
"bin" = "bin"
90
+
### Profiles
101
91
102
-
# ZSH
103
-
"zsh/zprofile" = ".zprofile"
104
-
"zsh/zshrc" = ".zshrc"
105
-
"zsh/zshrc.d" = ".zshrc.d"
106
-
"zsh/zlogin" = ".zlogin"
92
+
*Profile* is a typical [dotbro.toml](dotbro.toml) (or `dotbro.json`) file. It defines directories and mappings.
107
93
108
-
# Vim
109
-
"vim/vimrc" = ".vimrc"
94
+
You can have multiple profiles for different purposes. For example, you can have a profile for your work environment and another for your personal environment.
110
95
111
-
"git/commit_template" = ".gitcommit"
112
-
"git/config" = ".gitconfig"
113
-
"git/excludes" = ".gitexcludes"
96
+
Profile can be either TOML or JSON file.
97
+
TOML is peferred, because it's a bit clearer and allows comments.
98
+
However, JSON is good option for profiles without explicit mapping, it's short and simple.
See more examples in [config_examples](https://github.com/hypnoglow/dotbro/tree/master/config_examples) directory of this repo.
121
105
122
-
### Options
106
+
####Options
123
107
124
-
Config has 3 sections:
108
+
Profile has 3 sections:
125
109
- directories
126
110
- mapping
127
111
- files
@@ -130,7 +114,7 @@ Config has 3 sections:
130
114
131
115
Option | Description | Example | Default
132
116
--- | --- | --- | ---
133
-
dotfiles | Directory of your dotfiles repository. | `$HOME/dotfiles` | Directory of your config file.
117
+
dotfiles | Directory of your dotfiles repository. | `$HOME/dotfiles` | Directory of your profile file.
134
118
sources | Directory relative to `dotfiles` where dotfiles are stored. You want to set this option if you keep your dotfiles in a subdirectory of your repo. By default this is empty, assuming your dotfiles are on the first level of `dotfiles` directory. | `src` | none
135
119
destination | Your dotfiles will be linked there. | `$HOME` | `$HOME`
136
120
backup | Your original files will be backuped there. | `$HOME/backups/dotfiles` | `$HOME/.dotfiles~`
0 commit comments