#!/bin/sh if test -z "$1"; then printf "Usage: %s machine\n" "$0" 1>&2 exit 64 # sysexits(3) EX_USAGE fi case "$1" in "carnation") MACHINE="noire-carnation" ;; "rose") MACHINE="noire-rose" ;; esac for item in "$MACHINE"/config/* do inst_path="$(printf "%s\n" "$item" | sed "s/$MACHINE\/config\///g")" printf "Creating symlink from %s to %s\n" "$PWD/$item" "$XDG_CONFIG_HOME/$inst_path" 1>&2 ln -sf "$PWD/$item" "$XDG_CONFIG_HOME/$inst_path" done ln -sf "$PWD/$MACHINE/profile" "$HOME/.profile" printf "%s: Please set \$ZDOTDIR to \$XDG_CONFIG_HOME/zsh\n" "$0" 1>&2