#!/usr/bin/env zsh # We need the environment to be able to symlink files accordingly case "$1" in desktop) EXTENSION="desktop" ;; thinkpad) EXTENSION="thinkpad" ;; esac for d in $(find -- */ -maxdepth 0 -type d | cut -f1 -d '/'); do echo "Linking $d..." (stow -t "$HOME" "$d") done if [ ! -z "$EXTENSION" ]; then echo "\n\nDon't forget to symlink these files:\n\n" find ~ \( -type l -o -type f \) -name "*.$EXTENSION" -exec ls -al {} \; fi