############################################################################### # Tyler Perkins # 2-7-21 # Makefile # SRC = ./src PROGRAMS = calcurse nvim newsboat mpv bash compton sc-im aerc .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 #sc-im @which sc-im > /dev/null 2>&1 @if [ $$? -eq 0 ];then \ echo "sc-im found! Installing config..."; \ [ -f ~/.config/sc-im/scimrc ] && mv ~/.config/sc-im/scimrc ~/.config/sc-im/scimrc.old; \ cp $(SRC)/sc-im/scimrc ~/.config/sc-im/scimrc; \ fi #aerc @which aerc > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "aerc found! Installing configs...";\ [ -f ~/.config/aerc/accounts.conf ] && mv ~/.config/aerc/accounts.conf ~/.config/aerc/accounts.conf.old; \ cp $(SRC)/aerc/accounts.conf ~/.config/aerc/accounts.conf; \ [ -f ~/.config/aerc/aerc.conf ] && mv ~/.config/aerc/aerc.conf ~/.config/aerc/aerc.conf.old; \ cp $(SRC)/aerc/aerc.conf ~/.config/aerc/aerc.conf; \ [ -f ~/.config/aerc/binds.conf ] && mv ~/.config/aerc/binds.conf ~/.config/aerc/binds.conf.old; \ cp $(SRC)/aerc/binds.conf ~/.config/aerc/binds.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 #sc-im #@which sc-im > /dev/null 2>&1 #@if [ $$? -eq 0 ]; then \ # echo "sc-im found! Updating config files with existing versions..."; \ # [ -f ~/.config/sc-im/scimrc ] && cp ~/.config/sc-im/scimrc $(SRC)/sc-im/scimrc; \ #fi #aerc @which aerc > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "aerc found! Updating config files with existing versions..."; \ [ -f ~/.config/aerc/accounts.conf ] && cp ~/.config/aerc/accounts.conf $(SRC)/aerc/accounts.conf; \ [ -f ~/.config/aerc/aerc.conf ] && cp ~/.config/aerc/aerc.conf $(SRC)/aerc/aerc.conf; \ [ -f ~/.config/aerc/binds.conf ] && cp ~/.config/aerc/binds.conf $(SRC)/aerc/binds.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 config files and reinstalling *.old"; \ [ -f ~/.config/compton.old ] && mv ~/.config/compton.conf.old ~/.config/compton.conf; \ fi #sc-im @which sc-im > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "sc-im found! removing existing config files and reinstalling *.old"; \ [ if ~/.config/sc-im/scimrc ] && mv ~/.config/sc-im/scimrc.old ~/.config/sc-im/scimrc; \ fi #aerc @which aerc > /dev/null 2>&1 @if [ $$? -eq 0 ]; then \ echo "aerc found! removing existing config files and reinstalling *.old"; \ [ if ~/.config/aerc/accounts.conf.old ] && mv ~/.config/aerc/accounts.conf.old ~/.config/aerc/accounts.conf; \ [ if ~/.config/aerc/aerc.conf.old ] && mv ~/.config/aerc/aerc.conf.old ~/.config/aerc/aerc.conf; \ [ if ~/.config/aerc/binds.conf.old ] && mv ~/.config/aerc/binds.conf.old ~/.config/aerc/binds.conf; \ fi