| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function prepare_doLinks { |
| |
| local -a LINKS_SRC |
| local -a LINKS_DST |
| local SUFFIX='centos' |
| local USERFILES='' |
| local PALETTE='' |
| local BRUSH='' |
| local PATTERN='' |
| local FONT='' |
| local FILE='' |
| local COUNT=0 |
| |
| |
| |
| local GIMP_HOME=${HOME}/.$(rpm -q gimp | cut -d. -f-2) |
| local INKS_HOME=${HOME}/.inkscape |
| |
| |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${HOME}/bin/$CLI_PROGRAM |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${CLI_BASEDIR}/${CLI_PROGRAM}.sh |
| USERFILES="${HOME}/bin/$CLI_PROGRAM" |
| |
| |
| for FONT in $(cli_getFilesList ${HOME}/artwork/trunk/Identity/Fonts --pattern='.+\.ttf');do |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${HOME}/.fonts/$(basename $FONT) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=$FONT |
| done |
| |
| |
| for PALETTE in $(cli_getFilesList ${HOME}/artwork/trunk/Identity/Palettes --pattern=".+\.gpl");do |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_HOME}/palettes/${SUFFIX}-$(basename $PALETTE) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=$PALETTE |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${INKS_HOME}/palettes/${SUFFIX}-$(basename $PALETTE) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=$PALETTE |
| done |
| |
| |
| for BRUSH in $(cli_getFilesList ${HOME}/artwork/trunk/Identity/Brushes --pattern=".+\.(gbr|gih)");do |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_HOME}/brushes/${SUFFIX}-$(basename $BRUSH) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=$BRUSH |
| done |
| |
| |
| for PATTERN in $(cli_getFilesList ${HOME}/artwork/trunk/Identity/Patterns --pattern=".+\.png");do |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_HOME}/patterns/${SUFFIX}-$(basename $PATTERN) |
| LINKS_DST[((++${#LINKS_DST[*]}))]=$PATTERN |
| done |
| |
| |
| if [[ $EDITOR == '/usr/bin/vim' ]];then |
| LINKS_SRC[((++${#LINKS_SRC[*]}))]=${HOME}/.vimrc |
| LINKS_DST[((++${#LINKS_DST[*]}))]=${PREPARE_CONFIG_DIR}/vimrc |
| USERFILES="${USERFILES} ${HOME}/.vimrc" |
| fi |
| |
| |
| |
| |
| |
| |
| USERFILES=$(echo "$USERFILES"; |
| cli_getFilesList ${HOME}/bin --pattern='.+\.sh'; |
| cli_getFilesList ${HOME}/.fonts --pattern='.+\.ttf'; |
| cli_getFilesList ${GIMP_HOME}/brushes --pattern='.+\.(gbr|gih)'; |
| cli_getFilesList ${GIMP_HOME}/patterns --pattern='.+\.(pat|png|jpg|bmp)'; |
| cli_getFilesList ${GIMP_HOME}/palettes --pattern='.+\.gpl'; |
| cli_getFilesList ${INKS_HOME}/palettes --pattern='.+\.gpl';) |
| |
| |
| |
| |
| if [[ "$USERFILES" != '' ]];then |
| rm -r $USERFILES |
| fi |
| |
| while [[ $COUNT -lt ${#LINKS_SRC[*]} ]];do |
| |
| |
| cli_printMessage "${LINKS_SRC[$COUNT]}" --as-creating-line |
| |
| |
| if [[ ! -d $(dirname ${LINKS_SRC[$COUNT]}) ]];then |
| mkdir -p $(dirname ${LINKS_SRC[$COUNT]}) |
| fi |
| |
| |
| ln ${LINKS_DST[$COUNT]} ${LINKS_SRC[$COUNT]} --symbolic --force |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| } |