10_symlinks.sh (1941B)
1 #!/usr/bin/env bash 2 3 # shopt -s dotglob 4 # for f in links/*; do 5 # 6 # # Skip . and .. 7 # [ "$f" = "." ] && continue 8 # [ "$f" = ".." ] && continue 9 # 10 # # Skip shell scripts and markdown 11 # [ "${f##*.}" = "md" ] && continue 12 # 13 # # Do not symlink these files/directories 14 # [[ "$f" =~ tags|.git/|.DS_Store|bar/|userChrome.css|init/ ]] && continue 15 # 16 # # .xinitrc doesn't work with XQuartz 17 # [[ "$(uname)" = "Darwin" && "$f" == ".xinitrc" ]] && continue 18 # 19 # SOURCE=$PWD/$f 20 # TARGET=~/$(basename $f) 21 # 22 # # Rename any original files or directories 23 # [ -f $TARGET ] && mv $TARGET ${TARGET}_bck 24 # [ -d $TARGET ] && mv $TARGET ${TARGET}_bck 25 # 26 # # Remove old symlinks 27 # [ -L $TARGET ] && rm $TARGET 28 # 29 # ln -sv $SOURCE $TARGET 30 # done 31 # 32 # # Create folders and non-symlink files 33 # mkdir -p ~/.ipython/profile_default 34 # mkdir -p ~/.mutt/cache 35 # chmod 0700 ~/.mutt/cache 36 # [ -f ~/.mutt/aliases ] || touch ~/.mutt/aliases 37 # mkdir -p ~/tmp 38 # 39 # # Symlink directories from iCloud drive to home 40 # if [ "$(uname)" = "Darwin" ]; then 41 # ln -shvf ~/Library/Mobile\ Documents/com\~apple\~CloudDocs \ 42 # ~/iCloud 43 # ln -shvf ~/iCloud/articles ~/articles 44 # ln -shvf ~/iCloud/articles/own/BIBnew.bib \ 45 # $(kpsexpand '$TEXMFHOME')/bibtex/bib/myfiles/BIB.bib 46 # ln -shvf ~/iCloud/articles/own/BIBnew.bib \ 47 # $(kpsexpand '$TEXMFHOME')/bibtex/bib/BIB.bib 48 # ln -shvf ~/iCloud/src ~/src 49 # ln -shvf ~/iCloud/doc ~/doc 50 # ln -shvf ~/doc/.password-store ~/.password-store 51 # ln -shvf ~/iCloud/uni ~/uni 52 # ln -shvf ~/iCloud/videos ~/videos 53 # ln -shvf \ 54 # ~/Library/Mobile\ Documents/27N4MQEA55~pro~writer/Documents/ \ 55 # ~/iawriter 56 # ln -shvf misc_code/firefox/userContent.css \ 57 # ~/Library/Application\ Support/Firefox/Profiles/ 58 # 59 # # XQuartz.app doesn't work with .xinitrc 60 # [ -L ~/.xinitrc ] && rm ~/.xinitrc 61 # fi 62 63 [ -x ~/bin/shortcuts ] && ~/bin/shortcuts