Dotfiles install and backup script

This commit is contained in:
Christian Colglazier 2019-09-04 16:19:59 -04:00
parent 63a9f7a787
commit 9e6448c6ae
2 changed files with 37 additions and 0 deletions

21
.dotfiles/.zshrc Normal file
View File

@ -0,0 +1,21 @@
HISTFILE=~/.zsh_history
HISTSIZE=99999999
SAVEHIST=99999999
setopt appendhistory autocd extendedglob nomatch notify
unsetopt beep
bindkey -e
zstyle :compinstall filename '~/.zshrc'
autoload -Uz compinit
compinit
# Text Editor
alias emacs='emacs -nw'
alias e='emacs -nw'
alias i='sudo dnf install'
alias d='sudo dnf'
alias c='git commit -m '
alias g='git'
alias gp='git pull'
export TERM=linux

16
scripts/dotfiles.sh Normal file
View File

@ -0,0 +1,16 @@
#! /bin/bash
# source backup sudo
files=(~/.zshrc ~/.config/.dotfiles/.zshrc 'n')
for (( i=0; i<${#files[@]} ; i+=3 )) ; do
if [[ $* == *-b* ]]; then
cp ${files[i]} ${files[i+1]}
else
if [[ ${files[i+2]} == *'y'* ]]; then
sudo cp ${files[i+1]} ${files[i]}
else
cp ${files[i+1]} ${files[i]}
fi
fi
done