From a0cf29ab0b75205658a9ab4f31eb6c8d7ab5104b Mon Sep 17 00:00:00 2001 From: Mark Riedesel Date: Fri, 19 Jul 2019 14:55:40 -0500 Subject: [PATCH] add Xresources --- Xresources | 1 + _install.sh | 39 +++++++++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 6 deletions(-) create mode 120000 Xresources diff --git a/Xresources b/Xresources new file mode 120000 index 0000000..1966c42 --- /dev/null +++ b/Xresources @@ -0,0 +1 @@ +../.cache/wal/colors.Xresources \ No newline at end of file diff --git a/_install.sh b/_install.sh index bc6b819..777f1d4 100755 --- a/_install.sh +++ b/_install.sh @@ -25,9 +25,10 @@ function die() { exit 1 } -function link() { - src=$1 - dst=$2 +function install() { + method=$1 + src=$2 + dst=$3 if [ -e $dst ]; then if [ -L $dst ]; then # already symlinked @@ -43,8 +44,26 @@ function link() { fi fi - # Update existing or create new symlinks - ln -vsf $src $dst + case $method in + link) + # Update existing or create new symlinks + ln -vsf $src $dst + ;; + copy) + cp -a $src $dst + ;; + *) + warn "Unknown install method: $1" + ;; + esac +} + +function link() { + install link $1 $2 +} + +function copy() { + install copy $1 $2 } function unpack_tarball() { @@ -93,7 +112,15 @@ for path in * ; do if [ $(expr match $path '^_') -eq 1 ]; then continue fi - link $basedir/$path $homedir/.$path + + src=$basedir/$path + dst=$homedir/.$path + + if [ -L $src ]; then + copy $src $dst + else + link $src $dst + fi done mkdir -p $homedir/.config