Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- myHome=$HOME
- files[1]="$myHome/.config/compton.conf";
- files[2]="$myHome/.config/awesome/";
- files[3]="$myHome/.config/fontconfig/conf.d/00-earnestly.conf";
- files[4]="$myHome/.bashrc";
- files[5]="$myHome/.gitconfig";
- files[6]='/etc/pacman.conf';
- files[7]='/etc/X11/xorg.conf.d/';
- files[8]="$myHome/.i3/";
- files[9]="$myHome/.weechat-info";
- cdCmd="cd $myHome/Repositories/dotfiles/"
- pkglist="pacman -Qqen > pkglist.txt"
- curDate=$(date +%d-%b-%H_%M)
- gitCommands="git add .; git commit -m '$curDate'; git push;"
- for file in "${files[@]}"; do
- if [[ $file == *"etc"* ]]; then
- noPath=${file#*/};
- else
- noPath=${file#$myHome}
- fi
- if [[ $file == *"/" ]]; then
- mkdir -p "$myHome/Repositories/dotfiles/${noPath}";
- rsync -rl --exclude=".git" "$file"* "$myHome/Repositories/dotfiles/${noPath}";
- else
- rsync -rl --exclude=".git" "$file" "$myHome/Repositories/dotfiles/${noPath}";
- fi
- done
- eval $cdCmd
- eval "$pkglist"
- eval "${gitCommands}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement