42 lines
2.4 KiB
Bash

#!/bin/bash
#Collection of funtions and aliases to automate the redundant tasks.
#First let's declare a few variables
export company="SCAR-719"
update-DOTFiles() { #This command takes the local copies and puts them into the git repo for updating
rsync -r /etc/portage/* $HOME/Projects/$company/repos/DOT-Files/$(awk -F"=" '{print $2}' /etc/lsb-release | sed 's/"//g')/$HOSTNAME/etc/portage/. ;
rsync -r /usr/src/linux/.config $HOME/Projects/$company/repos/DOT-Files/Gentoo/gentooamd/kernel/kernel-config-$(uname -r) ;
rsync -r --exclude="heroic" --exclude="quassel-irc.org" --exclude="google-chrome" --exclude="PCSX2" --exclude="transmission" --exclude="legendary" --exclude="Element" \
--exclude="balena-etcher-electron" --exclude="discord" --exclude="discord.bak" --exclude="heroic" --exclude="Slack" --exclude="Code" --exclude="Epic" --exclude="obs-studio" --exclude="BraveSoftware" --exclude="vivaldi" \
--exclude="microsoft-edge" --exclude="vesktop" --exclude="Jitsi Meet" --exclude="tox" \
--exclude="Nextcloud" --exclude="SessionCache.ini" --exclude="balenaEtcher" --exclude="binwalk" \
--exclude="cni" --exclude="Genymobile" --exclude="gmsartcontrol" --exclude="kdiskmark" \
--exclude="libfm" --exclude="Mangohud" --exclude="MangoHud" --exclude="menus" --exclude="msmtp" \
--exclude="mupen64plus" --exclude="ookla" --exclude="privateinternetaccess" --exclude="spicy" \
--exclude="spotify" --exclude="sqlitebrowser" --exclude="unity3d" --exclude="wireshark" \
--exclude="libreoffice" \
$HOME/.config/* $HOME/Projects/$company/repos/DOT-Files/Gentoo/gentooamd/home/user/.config/. ;
rsync -r $HOME/.*rc $HOME/Projects/$company/repos/DOT-Files/Gentoo/gentooamd/home/user/. ;
rsync -r $HOME/.local/bin $HOME/Projects/$company/repos/DOT-Files/Gentoo/$HOSTNAME/home/.local/ ;
cd /home/ganome/Projects/$company/repos/DOT-Files ;
git pull ;
git add .;
git commit -am "Automated updated process of shell scripts and DOT Files ($HOSTNAME)" ;
git push;
cd - ;
}
replace-DOTFile() { #This command takes the git repo configs and moves them onto the local machine - in case remote edits were done and local machine needs updating
rsync -rhHAX /home/ganome/Projects/$company/repos/DOT-Files/gentoo/gentooamd/home/user/.bashrc /home/ganome/. ;
rsync -rhHAX /home/ganome/Projects/$company/repos/DOT-Files/gentoo/gentooamd/home/user/.config/shellconfig/* /home/ganome/.config/shellconfig/. ;
}