dotfiles/.init_config.sh

28 lines
583 B
Bash
Raw Normal View History

#!/bin/bash
LAPTOP="laptop"
DESKTOP="desk"
function usage() {
echo "$0: creates symlink for divergent config between laptop and desktop (e.g. battery management...)"
echo "usage: $0 [${LAPTOP}|${DESKTOP}]"
exit 0
}
if [ -z "{$1}" ] || [ "$#" -ne 1 ]; then
usage
fi
if [ "${1}" != "${LAPTOP}" ] && [ "${1}" != "${DESKTOP}" ]; then
usage
fi
for f in `find ~/.config -type f -name "*.${1}"`; do
echo "Symlinking to ${f}..."
ln -sf ${f} ${f%.*}
2019-01-26 19:24:25 +01:00
done
for f in `find ~ -maxdepth 1 -mindepth 1 -type f -name "*.${1}"`; do
echo "Symlinking to ${f}..."
ln -sf ${f} ${f%.*}
done