irongit

The dotfiles manager.

dothub/README.md
142 lines4.8 KBMarkdown
1<div align="center">
2 <img src="./doc/banner.png" />
3</div>
4<h4 align="center">
5 <a href="https://discord.gg/PdpX3vSHAC">Discord</a>
6 ·
7 <a href="https://crates.io/crates/dothub">Crates</a>
8</h4>
9<hr>
10
11A community driven dotfile management platform. This is a golden opportunity for
12beginners and experts alike to make contributions to the open source community.
13Contributing can be as simple as adding your dotfiles to the hub.yml.
14Help is also wanted to solve issues and create features.
15
16## Use Cases
17
18- Switch in and out of dotfiles with one command
19- [Share]./hub.yml your dotfiles with other dothub users
20- Effortlessly try out new dotfiles
21
22## Installation
23
24### Prequisites
25
26- Make sure you have the latest version of rust installed
27```bash
28rustup update
29```
30- Make sure the cargo binary directory is in your PATH
31
32```bash
33export PATH=$PATH:~/.cargo/bin
34```
35**Note:** You can configure root to use your default profile's cargo binaries too.
36```bash
37# .zshrc|.bashrc|etc
38export PATH=$PATH:/home/<my_user>/.cargo/bin
39```
40
41### Cargo Install
42
43Install via cargo
44```bash
45cargo install dothub
46```
47
48### Manual build
49```bash
50git clone https://github.com/huncholane/dothub
51cd dothub
52cargo install --path .
53```
54
55### yay
56
57Coming Soon
58
59### apt
60
61Coming Soon
62
63### Learn By Example
64
65This example will teach you how to use my personal nvim.
661. Install the config into dothub
67```bash
68dothub install https://github.com/huncholane/hygo-nvim
69```
70This simply clones the repository to `~/.local/share/dothub/hygo-nvim`.
71
72**Note:** You can tell dothub to install the repo as a specific name.
73```bash
74dothub install https://github.com/huncholane/hygo-nvim best-nvim
75```
76This will clone the repo into `~/.local/share/dothub/best-nvim`
77
782. Link to your config path
79```bash
80dothub link hygo-nvim nvim
81```
82This deletes whatever you have at `~/.config/nvim` and creates a symbolic link from `~/.local/share/dothub/hygo-nvim` to `~/.config/nvim` make sure you have saved your previous config however you like.
83
84#### More about the example
85
86Make sure you learn all you can about the config you are installing. DotHub will not handle third party setups for you. For example my personal nvim requires you to install [Yazi]https://github.com/sxyazi/yazi, the tui file explorer, so you will likely run into errors whenever you use dotfiles from new people.
87
88Also, people update config files pretty often, so to update yours, simply run `dothub update`. This will go through all of your installed dotfile repos and pull them to reflect the latest changes. **Note:** No feature yet to update specific repos.
89
90## Environment
91
92- **DOTHUB_DIR:** Specifies the path to install dothub repos. Defaults to `~/.local/share/dothub`
93
94This is particularly useful for the root user. If you want the root user to use the same dothub repos as your default user, you can add this to `/root/.zshrc`
95```bash
96# /root/.zshrc
97export DOTHUB_DIR=/home/<default_profile>/.local/share/dothub
98```
99- **GITHUB_TOKEN:** Your [github personal access token]https://github.com/settings/personal-access-tokens.
100
101Dothub tries to use the github api to retrieve stars and falls back to a less efficient scraping method. You want to set this to make dothub more efficient when using the base `dothub` command.
102
103## Commands
104
105- **dothub:** Displays all dothub profiles in the yml file located on this repo. To register your config files to dothub, fork the repo, make a feature, and submit a pull request. This is a goldmine for first contributions.
106- **dothub install [repo] [optional name]:** Installs a repo to your dothub path.
107- **dothub link [name] [config type]:** Deletes old config files and creates a symbolic link from the dothub path to your config type.
108- **dothub update:** Updates all of your dothub repos. Individual updates coming soon.
109- **dothub active:** Shows all current symbolic links managed by dothub.
110- **dothub list:** Shows all installed dothub repos. Currently just shows the names, more info coming soon.
111- **dothub remove:** Removes a downloaded repo from the dothub dir.
112- **dothub completions [shell type]:** Generates completions for the given shell to stdout.
113- **dothub help:** Brings up the help menu.
114
115## Completions
116
117I am just getting into creating completions. These will get better. Contributors thoroughly encouraged.
118
119### ZSH
120
121Add this to your .zshrc file if it doesn't exist. There might be a better way to do this. Contributors thoroughly encouraged.
122```bash
123# Add dothub completions
124mkdir -p ~/.zsh/completions
125fpath+=("$HOME/.zsh/completions")
126autoload -Uz compinit && compinit
127```
128After starting a new shell, run
129```bash
130dothub completions zsh > ~/.zsh/completions
131```
132
133### Help wanted for more guidance
134
135
136## Uninstall
137
138There might be a better way to do this. Idk, haven't put much effort into it. Contributors welcome.
139```bash
140cargo uninstall dothub
141rm -rf ~/.local/share/dothub
142```