reorganize dotfiles

This commit is contained in:
Daniel Bauer
2019-03-23 15:39:18 +01:00
parent 74602784b0
commit 30779f0939
51 changed files with 68 additions and 40 deletions

View File

@@ -1,25 +0,0 @@
Host *
ForwardX11 yes
PermitLocalCommand yes
#LocalCommand tar c -C${HOME} --exclude="dotfiles/.git" --exclude=".zim/.git" dotfiles .zim | ssh -o PermitLocalCommand=no %n "tar mx -C${HOME}; bash ~/dotfiles/dotfiles_setup.sh ; chsh -s /bin/zsh"
Host summonerapi
HostName 46.4.78.43
Host biodata0
User bauer
HostName biodata0.compbiol.bio.tu-darmstadt.de
Host bioclust
User bauer
HostName bioclust.bio.tu-darmstadt.de
Host bioinfo4
HostName 10.0.0.4
User bauer
ProxyCommand ssh -q biodata0 nc -q0 %h 22
Host lcluster?*
User yg38ymab
ForwardX11 yes
HostName %h.hrz.tu-darmstadt.de

57
dotfiles.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash
PROFILE_BASE_DIR=$HOME/.dotfiles/profiles
# Link files of a single profile
link_profile() {
profile=$1
profile_dir=${PROFILE_BASE_DIR}/$profile
if [ ! -d $profile_dir ]; then
echo "$profile does not exist"
exit 1
else
echo "Linking files from profile $profile"
fi
cd $profile_dir
# Find all files to link
for file in `find . -type f | cut -c 3- | grep -v "^$"`; do
dir=$(dirname "${file}")
src=`pwd`/$file
dst_dir=$HOME/$dir
dst=$HOME/$file
# create folder if not exist
if [ ! -d "$dst_dir" ]; then
echo "Creating destination direcory $dst_dir"
mkdir -p $dst_dir
fi
# link file
echo "Linking $src to $dst"
if [ -f "${dst}" ] || [ -L "${dst}" ]; then
echo "$dst_file esists. Override? [y/N]"
read response
if [ "$response" == 'y' ] || [ "$response" == 'Y' ] \
|| [ "$response" == 'yes' ] || [ "$response" == 'Yes' ]; then
ln -sf $src $dst
else
echo "Skipping $file"
fi
else
ln -s $src $dst
fi
done
}
# link profiles
if [ "$1" == "link" ]; then
shift
while [ "$1" != "" ]; do
link_profile $1
shift
done
fi

View File

@@ -1,15 +0,0 @@
#!/bin/bash
dir="${HOME}/dotfiles"
conffolder="${HOME}/.config"
dotfiles=(".vimrc" ".vim" ".vimrc" ".zshrc" ".zshrc_functions" ".zim" ".zimrc" ".gitconfig")
for dotfile in "${dotfiles[@]}"; do
ln -sf $dir/$dotfile ${HOME}/${dotfile}
done
# fonts
mkdir -p ~/.config/fontconfig
ln -sf $dir/.config/fontconfig/fonts.conf $conffolder/fontconfig/fonts.conf
# matplotlib
ln -sf $dir/.config/matplotlib ~/.config/matplotlib

10
install.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Make ZSH the default shell environment
if [ `cat /etc/passwd | grep $USER | awk -F ':' '{print $7}'` != "/bin/zsh" ]; then
echo "Changing shell to zsh"
chsh -s $(which zsh)
fi
# linking base stuff
$HOME/.dotfiles/dotfiles.sh link base

View File

@@ -0,0 +1 @@
/home/bauer/dotfiles/.pymol