Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RaphGL/Tuckr
Super powered replacement for GNU Stow
https://github.com/RaphGL/Tuckr
dotfile-management dotfile-manager dotfiles stow
Last synced: about 1 month ago
JSON representation
Super powered replacement for GNU Stow
- Host: GitHub
- URL: https://github.com/RaphGL/Tuckr
- Owner: RaphGL
- License: gpl-3.0
- Created: 2020-02-22T19:34:47.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-16T17:21:01.000Z (3 months ago)
- Last Synced: 2024-09-17T19:37:00.668Z (3 months ago)
- Topics: dotfile-management, dotfile-manager, dotfiles, stow
- Language: Rust
- Homepage:
- Size: 210 KB
- Stars: 116
- Watchers: 3
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust - Tuckr
README
Tuckr
A super powered replacement for GNU Stow
Explore the docs »
·
Report Bug
·
Request Feature
Table of Contents
Tuckr is a dotfile manager inspired by Stow and Git. Tuckr aims to make dotfile management less painful. It follows the same model as Stow, symlinking files onto $HOME. It works on all the major OSes (Linux, Windows, BSDs and MacOS).
Tuckr aims to bring the simplicity of Stow to a dotfile manager with a very small learning curve.
To achieve that goal Tuckr tries to only cover what is directly needed to manage dotfiles and nothing else. We won't wrap git, rm, cp or reimplement the functionality that are perfeclty covered by other utilities in the system unless it greatly impacts usability.### Goals:
- No configuration
- Commands can be run from anywhere
- Symlinks are tracked and validated
- All configuration grouped and handled as a logical unit
- Provide hooks, optionally write configuration scripts for each group
- Easily encrypt and deploy sensitive configuration files## Getting Started
Tuckr uses a `dotfiles` directory to store all your configs. Please check the table below to know where
to put it according to your operating system.You can choose either the config or the home path.
| Platform | Config Path | Home Path |
| -------------- | ------------------------------------------ | -------------------- |
| Linux/BSDs/etc | $HOME/.config/dotfiles | $HOME/.dotfiles |
| MacOS | $HOME/Library/Application Support/dotfiles | $HOME/.dotfiles |
| Windows | %HomePath%\AppData\Roaming\dotfiles | %HomePath%\\.dotfiles |To learn how to set up your dotfiles, check the `How it works` sections.
#### Stow users
Tuckr is interchangeable with Stow. To migrate:
1. Go to your dotfiles directory remove all symlinks with
```
stow -t $HOME --delete *
```2. Move your dotfiles directory to one of the valid paths and convert your repo:
```
tuckr from-stow
```3. Resymlink your dotfiles with:
```
tuckr add \*
```4. Confirm that your dotfiles have been deployed:
```
tuckr status
```#### Windows users
You need to enable developer mode for symlinking to work, this is a restriction imposed by the OS.
### Installation
**Install from source:**
```sh
cargo install --git https://github.com/RaphGL/Tuckr.git
```Note: The binary will be installed to `$HOME/.cargo/bin` either move it to somewhere in your $PATH or add it to path.
**Install from the AUR:**
```sh
paru -S tuckr-git
```## Usage
```sh
$ tuckr add \* # adds all dotfiles to the system
$ tuckr add \* -e neovim # adds all dotfiles except neovim
$ tuckr add neovim zsh # adds the neovim and zsh dotfiles only
$ tuckr set \* # adds all the dotfiles and runs their hooks (scripts)
$ tuckr rm \* # removes all dotfiles from your system
``````
Super powered GNU Stow replacementUsage: tuckr [OPTIONS]
Commands:
status Get dotfiles' symlinking status (alias: s)
add Deploy dotfiles for the supplied groups (alias: a)
rm Remove dotfiles for the supplied groups
set Setup groups and run their hooks
encrypt Encrypt files and move them to dotfiles/Secrets (alias: e)
decrypt Decrypt files (alias: d)
push Copy files into groups
pop Remove groups from dotfiles/Configs
ls List dotfiles hooks, secrets, profiles
init Initialize dotfile directory
from-stow Convert a GNU Stow repo into Tuckr
groupis Return the group files belongs to
help Print this message or the help of the given subcommand(s)Options:
-p, --profile Choose which dotfile profile to use
-h, --help Print help
-V, --version Print version
```Note: for additional information also check [the wiki](https://github.com/RaphGL/Tuckr/wiki)
### How it works
Tuckr works with no configuration, this is achieved by making some assumptions about the structure of your dotfiles directory.
Every Tuckr dotfiles directory should have the following structure:```sh
dotfiles
├── Configs # Dotfiles go here
├── Secrets # Encrypted files go here
└── Hooks # Setup scripts go here
```These directories contain directories that separate the dotfiles by program name (or whatever you want to separate them by)
```sh
dotfiles
├── Configs
│ ├── tmux
│ └── zsh
└── Hooks
├── tmux
└── zsh
```Inside of these program directories the structure is exactly the same as what your $HOME looks like.
```sh
Configs
├── tmux
│ └── .config
│ └── tmux
│ └── tmux.conf
└── zsh
├── .zshenv
└── .zshrc
```The program directories' names are used to reference them in commands
### Using Hooks
Hooks are run before and after adding every program, if they're coupled with a program they should their directory should have the same name in Hooks as in Configs.
Hooks that run before symlinking the program are prefixed with `pre`, scripts that run afterwards are prefixed with `post`, as long as this is true you can name the file whatever you want.```sh
Hooks
├── tmux
│ ├── post.sh
│ └── pre.sh
└── zsh
├── post.sh
└── pre.sh
```To run scripts for a program run `tuckr set ` or alternatively use a wildcard like so: `tuckr set \*` to run all hooks.
### Using Secrets
#### Encrypting files
Encrypt a file and put it in
```
tuckr encrypt
```This will create an appropriate file in the `Secrets` directory pointing to the path where it originally came from
#### Decrypting files
Decrypt files from the groups and put them on their appropriate paths
```
tuckr decrypt
```### Conditional deployment
Conditional deployment is used when a dotfile should only be deployed on a specific platform. This is done by creating a separate group with the same name suffixed with the desired platform.This group is entirely ignored on unsupported systems.
Example:
```sh
Configs
├── config
├── config_unix # deployed on any unix system
├── config_linux # linux only files
├── config_macos # macos only files
└── config_windows # windows only files
```The groups that are supported on the target system will be treated as being a part of the original `config` group. One only needs to reference it to have all of the valid ones included as well.
Any of the [options available](https://doc.rust-lang.org/reference/conditional-compilation.html#target_os) on Rust's `target_family` and `target_os` are valid targets.
### Exit codes
For scripting purposes Tuckr has the following exit codes:
- `2` Could not find Dotfiles directory
- `3` No Configs/Hooks/Secrets directory setup
- `4` No such file or directory exists
- `5` Encryption failed
- `6` Decryption failedOn success Tuckr returns whatever is the default success return code for the platform (0 on unix systems).
## License
Distributed under GPLv3 License. See [`LICENSE`](https://github.com/RaphGL/Tuckr/blob/main/LICENSE) for more information.