############################################################################### # Tyler Perkins # 2-7-21 # Makefile # SRC = ./src PROGRAMS = calcurse nvim newsboat mpv bash compton .PHONY : install update clean install : #vim @which vim > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "vim found! Installing .vimrc ..."; \ [ -f ~/.vimrc ] && mv ~/vimrc ~/.vimrc.old; \ cp $(SRC)/vim/vimrc ~/.vimrc; \ fi #bash @which bash > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "bash found! Installing .bashrc ..."; \ [ -f ~/.bashrc ] && mv ~/.bashrc ~/.bashrc.old; \ cp $(SRC)/bash/bashrc ~/.bashrc; \ fi #calcurse @which calcurse > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "calcurse found! Installing configs..."; \ [ -f ~/.config/calcurse/conf ] && mv ~/.config/calcurse/conf ~/.config/calcurse/conf.old; \ cp $(SRC)/calcurse/conf ~/.config/calcurse/conf; \ [ -f ~/.config/calcurse/keys ] && mv ~/.config/calcurse/keys ~/.config/calcurse/keys.old; \ cp $(SRC)/calcurse/keys ~/.config/calcurse/keys; \ fi #newsboat @which newsboat > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "newsboat found! Installing config and urls..."; \ [ -f ~/.newsboat/config ] && mv ~/.newsboat/config ~/.newsboat/config.old; \ cp $(SRC)/newsboat/config ~/.newsboat/config; \ [ -f ~/.newsboat/urls ] && mv ~/.newsboat/urls ~/.newsboat/urls.old; \ cp $(SRC)/newsboat/urls ~/.newsboat/urls; \ fi #mpv @which mpv > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "mpv found! Installing config..."; \ [ -f ~/.config/mpv/mpv.conf ] && mv ~/.config/mpv/mpv.conf ~/.config/mpv/mpv.conf.old; \ cp $(SRC)/mpv/mpv.conf ~/.config/mpv/mpv.conf; \ fi #compton @which compton > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "compton found! Installing config, changes will not take effect till compton is restarted..."; \ [ -f ~/.config/compton.conf ] && mv ~/.config/compton.conf ~/.config/compton.conf.old; \ cp $(SRC)/compton/compton.conf ~/.config/compton.conf; \ fi update: #vim @which vim > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "vim found! Updating vimrc files with existing versions..."; \ [ -f ~/.vimrc ] && cp ~/.vimrc $(SRC)/vim/vimrc; \ fi #bash @which bash > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "bash found! Updating bashrc files with existing versions..."; \ [ -f ~/.bashrc ] && cp ~/.bashrc $(SRC)/bash/bashrc; \ fi #calcurse @which calcurse > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "calcurse found! Updating config files with existing versions..."; \ [ -f ~/.config/calcurse/conf ] && cp ~/.config/calcurse/conf $(SRC)/calcurse/conf; \ [ -f ~/.config/calcurse/keys ] && cp ~/.config/calcurse/keys $(SRC)/calcurse/keys; \ fi #newsboat @which newsboat > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "newsboat found! Updating config files with existing versions..."; \ [ -f ~/.newsboat/config ] && cp ~/.newsboat/config $(SRC)/newsboat/config; \ [ -f ~/.newsboat/urls ] && cp ~/.newsboat/urls $(SRC)/newsboat/urls; \ fi #mpv @which mpv > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "mpv found! Updating config files with existing versions..."; \ [ -f ~/.config/mpv/mpv.conf ] && cp ~/.config/mpv/mpv.conf $(SRC)/mpv/mpv.conf; \ fi #compton @which compton > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "compton found! Updating config files with existing versions..."; \ [ -f ~/.config/compton.conf ] && cp ~/.config/compton.conf $(SRC)/compton/compton.conf; \ fi clean : #vim @which vim > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "vim found! removing existing config files and reinstalling *.old"; \ [ -f ~/.vimrc.old ] && mv ~/.vimrc.old ~/.vimrc; \ fi #bash @which bash > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "bash found! removing existing config files and reinstalling *.old"; \ [ -f ~/.bashrc.old ] && mv ~/.bashrc.old ~/.bashrc; \ fi #calcurse @which calcurse > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "calcurse found! remvoing existing config files and reinstalling *.old"; \ [ -f ~/.config/calcurse/conf.old ] && mv ~/.config/calurse/conf.old ~/.config/calcurse/conf; \ [ -f ~/.config/calcurse/keys.old ] && mv ~/.config/calurse/keys.old ~/.config/calcurse/keys; \ fi #newsboat @which newsboat > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "newsboat found! removing existing config files and reinstalling *.old"; \ [ -f ~/.newsboat/config.old ] && mv ~/.newsboat/config.old ~/.newsboat/config; \ [ -f ~/.newsboat/urls.old ] && mv ~/.newsboat/urls.old ~/.newsboat/urls; \ fi #mpv @which mpv > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "mpv found! removing existing config files and reinstalling *.old"; \ [ -f ~/.config/mpv/mpv.conf.old ] && mv ~/.config/mpv/mpv.conf.old ~/.config/mpv/mpv.conf; \ fi #compton @which compton > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "compton found! remvoing existing confi files and reinstalling *.old"; \ [ -f ~/.config/compton.old ] && mv ~/.config/compton.conf.old ~/.config/compton.conf; \ fi