aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.stowrc1
-rw-r--r--README.md70
-rwxr-xr-xtmux/.local/bin/tmux-projectr2
3 files changed, 60 insertions, 13 deletions
diff --git a/.stowrc b/.stowrc
index 9504469..e26aafc 100644
--- a/.stowrc
+++ b/.stowrc
@@ -1,3 +1,4 @@
+--target=$HOME
--verbose
--no-folding
--ignore=^install.sh
diff --git a/README.md b/README.md
index 2f235ca..4293690 100644
--- a/README.md
+++ b/README.md
@@ -3,26 +3,72 @@
## Install
```sh
-git clone https://git.tobyvin.dev/.dotfiles ~/.dotfiles && cd ~/.dotfiles && ./install.sh
+git clone https://git.tobyvin.dev/.dotfiles && ./.dotfiles/install.sh
```
## Getting started
-The configuration files are managed using GNU [stow]. The included [install.sh]
-script will install specified (or, if unspecified, all) packages using
-`./install.sh [package ..]`. The script will also do it's best to clean broken
-symlinks from `$HOME` that belong to the repository, and is fairly strict about
-what links it will remove, erroring on the side caution as to not remove any
-symlinks that do (or did) not belong to the repository.
+The configuration files are managed using GNU [stow] and the dotfiles can be
+installed solely by running `stow */` from the repository's root.
+
+### Install script
+
+A [install.sh] helper script is provided that will stow packages, remove broken
+symlinks, and run package specific install scripts. The install script can be
+run with `./install.sh [package ..]`, defaulting to operating on all packages if
+none are specified.
+
+#### Removing broken symlinks
+
+The install script will do it's best to clean broken symlinks from the target
+directory. It's fairly strict about what it will remove, erroring on the side
+caution, as to not remove any symlinks that do (or did) not belong to the
+repository.
+
+#### Package specific install scripts
+
+The install script will run any package specific install scripts that exist in
+the root of a package directory, e.g. `./<pkgname>/install.sh`.
+
+Example usecases:
+
+- Creating non-existent directories
+- Enabling systemd user services
+- Fixing file permissions
+- Running one-time setup commands
+- etc.
+
+##### Example package install script
+
+```sh
+#!/bin/sh
+
+pkgname=<pkgname>
+
+if ! command -v "$pkgname" >/dev/null; then
+ printf '%s: %s not found, skipping...\n' "$0" "$pkgname"
+ exit 0
+fi
+
+mkdir -pv "${XDG_CACHE_HOME}/${pkgname}"
+
+printf "%s: Installing service\n" "$0"
+systemctl --user enable --now --no-block "${pkgname}.service"
+```
+
+More examples: [zsh], [pass], and [nvim]
## Mirrors
I host this repository (and many others) on my local [cgit] instance, but it is
also mirrored to both [SourceHut] and [GitHub].
-[cgit]: <https://git.tobyvin.dev>
-[SourceHut]: <https://git.sr.ht/~tobyvin/.dotfiles>
-[GitHub]: <https://github.com/tobyvin/.dotfiles>
-[.dotfiles]: <https://git.tobyvin.dev/.dotfiles>
+[.dotfiles]: https://git.tobyvin.dev/.dotfiles
+[cgit]: https://git.tobyvin.dev
+[github]: https://github.com/tobyvin/.dotfiles
[install.sh]: ./install.sh
-[stow]: <https://www.gnu.org/software/stow/>
+[nvim]: ./nvim/install.sh
+[pass]: ./pass/install.sh
+[sourcehut]: https://git.sr.ht/~tobyvin/.dotfiles
+[stow]: https://www.gnu.org/software/stow/
+[zsh]: ./zsh/install.sh
diff --git a/tmux/.local/bin/tmux-projectr b/tmux/.local/bin/tmux-projectr
index 77116dc..9dfb1b9 100755
--- a/tmux/.local/bin/tmux-projectr
+++ b/tmux/.local/bin/tmux-projectr
@@ -15,7 +15,7 @@ if [ "$#" -eq 0 ]; then
# shellcheck disable=2046
set -- $(
- projectr -mgt ~/.local/src -P ~/.dotfiles --exclude-cwd |
+ projectr -mgt ~/.local/src --exclude-cwd |
fzf-tmux -p100,30 -- --tac --exit-0 -d/ --with-nth -1 \
--bind "focus:transform-header(echo {} | sed 's|$HOME|~|')" \
--preview-window='right,60,<60(hidden)' --preview="$PREVIEW_CMD"