Git Product home page Git Product logo

wstow's Introduction

wstow :- A stow wrapper

What ?

wstow is a wrapper around GNU stow that makes it easier to make symlinks from multiple sources to multiple targets easily.

Why ?

GNU stow is a symlink maker and manager that makes multiple symlinks easier. However, it still lacks some capabilites that makes it difficult to symlink multiple distinct package groups. Take a look at following example :
[Here assumed current working directory is home ( ~ or /home/<username>) and dotfiles is at ~/path/to/dotfiles ]


  • To make symlinks to multiple folders under your config directory, eg : vifm, nvim, bat, zsh with stow
  1. got to .config directory ( cd ~/.config )
  2. Create vifm directory ( mkdir vifm )
  3. Go to vifm directory ( cd vifm )
  4. Use stow to symlink ( stow -v -t ./ -d ../path/to/dotfiles/.config -S vifm )
  5. go back to .config directory ( cd .. )
  6. Repeat from step 2 replacing 'vifm' with any other package name ( like nvim, zsh , alacritty)

  • To make symlinks to multiple folders under your config directory, eg : vifm, nvim, bat, zsh with wstow
  1. wstow file ../path/to/dotfiles/.config ./ vifm alacritty zsh bat ( The syntax is like this :- wstow mode SOURCE_DIR TARGET_PARENT_DIR PACKAGE_NAMES )

Dependencies

  1. Stow
  2. find for ignore and fignore modes

Install

Just copy the script to anywhere in your PATH ( echo $PATH ). Make sure the script is executable ( chmod +x wstow )

Usage

The syntax for wstow is :- wstow mode SOURCE_DIR TARGET_PARENT_DIR PACKAGE_NAMES

  1. mode
  • dry :- Do not make any changes. Just do dry-run or simulate what the changes will be made with file mode

  • file :- For all the PACKAGE1, PACKAGE2,... from PACKAGE_NAMES make symlinks for all files from SOURCE_DIR/PACKAGE1,SOURCE_DIR/PACKAGE2,... inside the folder TARGET_PARENT_DIR/PACKAGE1, TARGET_PARENT_DIR/PACKAGE2,.. till all the PACKAGE_NAMES. Recurse into subdirectories in PACKAGE1, PACKAGE2,... and create symlinks. The subdirectories will also be created (stow --no-folding feature).

  • folder :- For all the PACKAGE1, PACKAGE2,... from PACKAGE_NAMES make symlinks for files and folder from SOURCE_DIR/PACKAGE1,SOURCE_DIR/PACKAGE2,... inside the folder TARGET_PARENT_DIR/PACKAGE1, TARGET_PARENT_DIR/PACKAGE2,.. till all the PACKAGE_NAMES. Symlinks for first level subdirectories are created without recursing like file mode.
    (Note โ— :- Files/folders deleted inside a symlinked folder will delete original source. To remove a symlinked folder, delete the symlinked folder. Deleting the contents inside will delete from original source.)

  • ignore :- Similar to file mode except all packages from SOURCE_DIR will be used except for those provided as PACKAGE_NAMES.

  • fignore :- Similar to folder mode except all packages from SOURCE_DIR will be used except for those provided as PACKAGE_NAMES.

  • restow :- Similar to folder mode except re-stow or repair symlinks

  • delete :- Similar to folder mode except delete symlinks. ( When used to remove symlinks from file mode, empty subdirectories would remain.) ###End

wstow's People

Contributors

rayz0rr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.