29 lines
568 B
Bash
Executable File
29 lines
568 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if test -z "$1"; then
|
|
printf "Usage: %s machine\n" "$0" 1>&2
|
|
exit 64 # sysexits.h(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/zshrc" "$HOME/.zshrc"
|
|
ln -sf "$PWD/$MACHINE/profile" "$HOME/.profile"
|