X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=sidebyside;f=bin%2Fsymlink.sh;h=d653a0b9d01001957dd8be53002ff1c0110afe46;hb=a77fc2bde4db1f695035846947ba6205c9807be9;hp=74cdb7bf2b74d90a6bc78d82cded8dcefc8f320e;hpb=2d1f18a11badc239cd7ab1638f8988087fd803ea;p=config
diff --git a/bin/symlink.sh b/bin/symlink.sh
index 74cdb7b..d653a0b 100755
--- a/bin/symlink.sh
+++ b/bin/symlink.sh
@@ -1,13 +1,18 @@
#!/bin/sh
set -x
+set -e
dir_minimal=~/config/dotfiles/minimal
-dir_user_minimal=~/config/dotfiles/user/minimal
-dir_user_thinkpad=~/config/dotfiles/user/thinkpad
-dir_user_X200s=~/config/dotfiles/user/x200s
-dir_user_T450s=~/config/dotfiles/user/t450s
-dir_user_server=~/config/dotfiles/user/server
+dir_user_prefix=~/config/dotfiles/user
+dir_user_minimal=$dir_user_prefix/minimal
+dir_user_machine=$dir_user_prefix/$1/minimal
+if [ "$3" = "" ]; then
+ dir_user_variety=$dir_user_prefix/$1/$2
+else
+ dir_user_variety=$dir_user_prefix/$1/$2/minimal
+fi
+dir_user_subvariety=$dir_user_prefix/$1/$2/$3
dir_root=~/config/dotfiles/root
homedir=`echo ~`
find ~ -lname $homedir'/config/*' -delete
@@ -22,22 +27,15 @@ else
for file in `ls $dir_user_minimal`; do
ln -fs $dir_user_minimal/$file ~/.$file
done
- if [ "$1" = "thinkpad" ]; then
- for file in `ls $dir_user_thinkpad`; do
- ln -fs $dir_user_thinkpad/$file ~/.$file
- done
- if [ "$2" = "x200s" ]; then
- for file in `ls $dir_user_X200s`; do
- ln -fs $dir_user_X200s/$file ~/.$file
- done
- else
- for file in `ls $dir_user_T450s`; do
- ln -fs $dir_user_T450s/$file ~/.$file
- done
- fi
- elif [ "$1" = "server" ]; then
- for file in `ls $dir_user_server`; do
- ln -fs $dir_user_server/$file ~/.$file
+ for file in `ls $dir_user_machine`; do
+ ln -fs $dir_user_machine/$file ~/.$file
+ done
+ for file in `ls $dir_user_variety`; do
+ ln -fs $dir_user_variety/$file ~/.$file
+ done
+ if [ ! "$3" = "" ]; then
+ for file in `ls $dir_user_subvariety`; do
+ ln -fs $dir_user_subvariety/$file ~/.$file
done
fi
fi