1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-09 08:19:17 +00:00

refactor installation doc

This commit is contained in:
deadc0de6
2022-05-27 11:51:39 +02:00
committed by deadc0de
parent 1584f33591
commit c4dab40c36
4 changed files with 26 additions and 61 deletions

View File

@@ -55,6 +55,7 @@ for more.
Quick start: Quick start:
```bash ```bash
## using dotdrop as a submodule
mkdir dotfiles && cd dotfiles mkdir dotfiles && cd dotfiles
git init git init
git submodule add https://github.com/deadc0de6/dotdrop.git git submodule add https://github.com/deadc0de6/dotdrop.git
@@ -86,16 +87,9 @@ why [dotdrop](https://github.com/deadc0de6/dotdrop) rocks.
# Installation # Installation
There are multiple ways to install and use dotdrop. See the [installation instructions](https://dotdrop.readthedocs.io/en/latest/installation/).
It is recommended to install dotdrop [as a submodule](#as-a-submodule)
to your dotfiles Git tree. Having dotdrop as a submodule guarantees that anywhere
you are cloning your dotfiles Git tree from you'll have dotdrop shipped with it.
The below instructions show how to install dotdrop as a submodule. For alternative Dotdrop is available on:
installation instructions, see the
[installation documentation](https://dotdrop.readthedocs.io/en/latest/installation/).
Dotdrop is also available on:
* PyPI: https://pypi.org/project/dotdrop/ * PyPI: https://pypi.org/project/dotdrop/
* Homebrew: https://formulae.brew.sh/formula/dotdrop * Homebrew: https://formulae.brew.sh/formula/dotdrop
@@ -104,46 +98,11 @@ Dotdrop is also available on:
* Snapcraft: https://snapcraft.io/dotdrop * Snapcraft: https://snapcraft.io/dotdrop
* pacstall: https://github.com/pacstall/pacstall-programs/blob/master/packages/dotdrop/dotdrop.pacscript * pacstall: https://github.com/pacstall/pacstall-programs/blob/master/packages/dotdrop/dotdrop.pacscript
## As a submodule
The following will create a git repository for your dotfiles and
keep dotdrop as a submodule:
```bash
## create the repository
$ mkdir dotfiles; cd dotfiles
$ git init
## install dotdrop as a submodule
$ git submodule add https://github.com/deadc0de6/dotdrop.git
$ pip3 install -r dotdrop/requirements.txt --user
$ ./dotdrop/bootstrap.sh
## use dotdrop
$ ./dotdrop.sh --help
```
For macOS users, make sure to install `realpath` through Homebrew
(part of *coreutils*).
Using dotdrop as a submodule will require you to work with dotdrop by
using the generated script `dotdrop.sh` at the root
of your dotfiles repository. Note that this script updates the submodule
automatically unless called with the environment variable `DOTDROP_AUTOUPDATE`
set to `no`.
To ease the use of dotdrop, it is recommended to add an alias to it in your
shell (*~/.bashrc*, *~/.zshrc*, etc.) with the config file path, for example:
```
alias dotdrop='<absolute-path-to-dotdrop.sh> --cfg=<path-to-your-config.yaml>'
```
Completion scripts exist for `bash`, `zsh` and `fish`; see [the related doc](completion/README.md).
# Getting started # Getting started
[Create a new repository](https://dotdrop.readthedocs.io/en/latest/repository-setup/) [Create a new repository](https://dotdrop.readthedocs.io/en/latest/repository-setup/)
to store your dotfiles with dotdrop. *Init* or *clone* that new repository and to store your dotfiles with dotdrop. *Init* or *clone* that new repository and
[install dotdrop](https://dotdrop.readthedocs.io/en/latest/installation/#as-a-submodule). [install dotdrop](https://dotdrop.readthedocs.io/en/latest/installation).
Then import any dotfiles (files or directories) you want to manage with dotdrop. Then import any dotfiles (files or directories) you want to manage with dotdrop.
You can either use the default profile (which resolves to the *hostname* of the host You can either use the default profile (which resolves to the *hostname* of the host

View File

@@ -24,7 +24,7 @@ and [link_on_import](https://dotdrop.readthedocs.io/en/latest/config-format/#con
Import the file: Import the file:
```bash ```bash
$ ./dotdrop.sh import ~/.bashrc $ dotdrop import ~/.bashrc
-> "/home/user/.bashrc" imported -> "/home/user/.bashrc" imported
``` ```
@@ -39,7 +39,7 @@ dotfiles:
Install the dotfile, which will remove your `~/.bashrc` and replace it with a link to the file stored in dotdrop: Install the dotfile, which will remove your `~/.bashrc` and replace it with a link to the file stored in dotdrop:
```bash ```bash
$ ./dotdrop.sh install $ dotdrop install
Remove "/home/user/.bashrc" for link creation? [y/N] ? y Remove "/home/user/.bashrc" for link creation? [y/N] ? y
-> linked /home/user/.bashrc to /home/user/dotdrop/dotfiles/bashrc -> linked /home/user/.bashrc to /home/user/dotdrop/dotfiles/bashrc

View File

@@ -15,15 +15,15 @@ For example:
`config-user.yaml` is used when managing the user's dotfiles: `config-user.yaml` is used when managing the user's dotfiles:
```bash ```bash
## user config file is config-user.yaml ## user config file is config-user.yaml
$ ./dotdrop.sh import --cfg config-user.yaml <some-dotfile> $ dotdrop import --cfg config-user.yaml <some-dotfile>
$ ./dotdrop.sh install --cfg config-user.yaml $ dotdrop install --cfg config-user.yaml
... ...
``` ```
`config-root.yaml` is used when managing the system's dotfiles and is to be used with `sudo` or directly by the root user: `config-root.yaml` is used when managing the system's dotfiles and is to be used with `sudo` or directly by the root user:
```bash ```bash
## root config file is config-root.yaml ## root config file is config-root.yaml
$ sudo ./dotdrop.sh import --cfg=config-root.yaml <some-dotfile> $ sudo dotdrop import --cfg=config-root.yaml <some-dotfile>
$ sudo ./dotdrop.sh install --cfg=config-root.yaml $ sudo dotdrop install --cfg=config-root.yaml
... ...
``` ```

View File

@@ -1,16 +1,20 @@
# Installation # Installation
Installing dotdrop [as a submodule](#as-a-submodule) is the recommended way. * PyPI: https://pypi.org/project/dotdrop/
* Homebrew: https://formulae.brew.sh/formula/dotdrop
If you want to keep your Python environment clean, use the virtualenv installation instructions * AUR (stable): https://aur.archlinux.org/packages/dotdrop/
(see [As a submodule in a virtualenv](#as-a-submodule-in-a-virtualenv) and * AUR (git version): https://aur.archlinux.org/packages/dotdrop-git/
[PyPI package in a virtualenv](#pypi-package-in-a-virtualenv)). * Snapcraft: https://snapcraft.io/dotdrop
In that case, the virtualenv environment might need to be loaded before any attempt to use dotdrop. * pacstall: https://github.com/pacstall/pacstall-programs/blob/master/packages/dotdrop/dotdrop.pacscript
## As a submodule ## As a submodule
Having dotdrop as a submodule guarantees that anywhere
you are cloning your dotfiles Git tree from you will have dotdrop shipped with it.
Note that when using dotdrop as a submodule you will be tracking the master branch (and not a specific version)
The following will create a Git repository for your dotfiles and The following will create a Git repository for your dotfiles and
keep dotdrop as a submodule: keep dotdrop as a submodule.
```bash ```bash
## create the repository ## create the repository
$ mkdir dotfiles; cd dotfiles $ mkdir dotfiles; cd dotfiles
@@ -28,9 +32,11 @@ $ ./dotdrop.sh --help
For macOS users, make sure to install `realpath` through Homebrew For macOS users, make sure to install `realpath` through Homebrew
(part of *coreutils*). (part of *coreutils*).
Using this solution will require you to work with dotdrop by Using dotdrop as a submodule will require you to work with dotdrop by
using the generated script `dotdrop.sh` at the root using the generated script `dotdrop.sh` at the root
of your dotfiles repository. of your dotfiles repository. Note that this script updates the submodule
automatically unless called with the environment variable `DOTDROP_AUTOUPDATE`
set to `no`.
To ease the use of dotdrop, it is recommended to add an alias to it in your To ease the use of dotdrop, it is recommended to add an alias to it in your
shell with the config file path; for example: shell with the config file path; for example:
@@ -170,7 +176,7 @@ $ git clone https://github.com/deadc0de6/dotdrop.git
``` ```
Start using it directly through the `dotdrop.sh` script and Start using it directly through the `dotdrop.sh` script and
use the `--cfg` to make it point to your config file. use the `--cfg` switch to make it point to your config file.
```bash ```bash
$ cd dotdrop/ $ cd dotdrop/