1
0
dotfiles/install.sh

28 lines
588 B
Bash
Raw Normal View History

2023-08-28 18:30:23 -06:00
#!/bin/sh
if test -z "$1"; then
printf "Usage: %s machine\n" "$0" 1>&2
2023-08-28 18:38:46 -06:00
exit 64 # sysexits.h(3) EX_USAGE
2023-08-28 18:30:23 -06:00
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