cleanup
This commit is contained in:
parent
76210537df
commit
636685b4f9
1 changed files with 53 additions and 38 deletions
91
Makefile
91
Makefile
|
@ -1,26 +1,27 @@
|
||||||
# Version control
|
# Version control
|
||||||
VC = git
|
VC = git
|
||||||
|
|
||||||
# Util
|
# Util
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
|
|
||||||
# Downloaders
|
# Downloaders
|
||||||
WGET = wget -q --show-progress
|
WGET = wget -q --show-progress
|
||||||
CURL = curl -s
|
CURL = curl -s
|
||||||
|
|
||||||
# Checkers
|
# Checkers
|
||||||
ARCH = $(shell grep -c "archlinux" /proc/version)
|
ARCH = $(shell grep -c "archlinux" /proc/version)
|
||||||
WSL = $(shell grep -c "WSL2" /proc/version)
|
WSL = $(shell grep -c "WSL2" /proc/version)
|
||||||
|
|
||||||
# Hide some verbose messages from Make
|
# Hide some verbose messages from Make
|
||||||
MAKEFLAGS += --no-print-directory
|
MAKEFLAGS += --no-print-directory
|
||||||
|
|
||||||
# Location
|
# Location
|
||||||
WIN_USER = anri
|
WIN_USER = anri
|
||||||
PFx86 = /mnt/c/Program\ Files\ \(x86\)
|
PFx86 = /mnt/c/Program\ Files\ \(x86\)
|
||||||
WIN_HOME = /mnt/c/Users/$(WIN_USER)
|
WIN_HOME = /mnt/c/Users/$(WIN_USER)
|
||||||
APPDATA = $(WIN_HOME)/AppData/Roaming
|
APPDATA = $(WIN_HOME)/AppData/Roaming
|
||||||
CSGO = $(PFx86)/Steam/steamapps/common/Counter-Strike\ Global\ Offensive/csgo/cfg
|
WIN_STEAM_USERDATA = $(filter-out "userdata",$(shell find $(PFx86)/Steam/userdata -maxdepth 1 -type d -printf "\"%f\" "))
|
||||||
|
CSGO_CFG = $(PFx86)/Steam/steamapps/common/Counter-Strike\ Global\ Offensive/csgo/cfg
|
||||||
|
|
||||||
all: full-sync
|
all: full-sync
|
||||||
|
|
||||||
|
@ -87,20 +88,8 @@ sync-dotfiles:
|
||||||
|
|
||||||
# === Specific platforms ==
|
# === Specific platforms ==
|
||||||
|
|
||||||
sync:
|
# Arch distro
|
||||||
# Check if at least the platform is supported
|
sync-arch:
|
||||||
ifneq (1, $(filter 1, $(ARCH) $(WSL)))
|
|
||||||
@echo "Unsupported platform"
|
|
||||||
else
|
|
||||||
|
|
||||||
# Call target of compatible with all supported platforms
|
|
||||||
@$(MAKE) sync-dotconfig
|
|
||||||
@$(MAKE) sync-dotfiles
|
|
||||||
@$(MAKE) sync-emacs
|
|
||||||
|
|
||||||
|
|
||||||
# Specific to Arch
|
|
||||||
ifeq ($(ARCH), 1)
|
|
||||||
# Fish
|
# Fish
|
||||||
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/config_arch.fish -O $(HOME)/.config/fish/config.fish
|
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/config_arch.fish -O $(HOME)/.config/fish/config.fish
|
||||||
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/abbr.fish -O $(HOME)/.config/fish/conf.d/abbr.fish
|
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/abbr.fish -O $(HOME)/.config/fish/conf.d/abbr.fish
|
||||||
|
@ -116,8 +105,8 @@ ifeq ($(ARCH), 1)
|
||||||
# VSCodium
|
# VSCodium
|
||||||
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/VSCodium/product.json -O $(HOME)/.config/VSCodium/product.json
|
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/VSCodium/product.json -O $(HOME)/.config/VSCodium/product.json
|
||||||
|
|
||||||
# Specific to WSL
|
# Windows Subsystem for Linux
|
||||||
else ifeq ($(WSL), 1)
|
sync-wsl:
|
||||||
# Fish
|
# Fish
|
||||||
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/config_wsl.fish -O $(HOME)/.config/fish/config.fish
|
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/config_wsl.fish -O $(HOME)/.config/fish/config.fish
|
||||||
@$(CURL) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/abbr_wsl.fish >> $(HOME)/.config/fish/conf.d/abbr.fish
|
@$(CURL) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/abbr_wsl.fish >> $(HOME)/.config/fish/conf.d/abbr.fish
|
||||||
|
@ -126,10 +115,8 @@ else ifeq ($(WSL), 1)
|
||||||
@mkdir -p $(HOME)/.unison
|
@mkdir -p $(HOME)/.unison
|
||||||
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.unison/default.prf -O $(HOME)/.unison/default.prf
|
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.unison/default.prf -O $(HOME)/.unison/default.prf
|
||||||
|
|
||||||
@echo "WSL synced!"
|
# Windows trough WSL
|
||||||
@echo
|
sync-windows:
|
||||||
|
|
||||||
# Windows
|
|
||||||
# Scripts
|
# Scripts
|
||||||
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/windows/ctmpf.bat -O $(WIN_HOME)/Documents/Local/ctmpf.bat
|
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/windows/ctmpf.bat -O $(WIN_HOME)/Documents/Local/ctmpf.bat
|
||||||
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/windows/spotx.bat -O $(WIN_HOME)/Documents/Local/spotx.bat
|
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/windows/spotx.bat -O $(WIN_HOME)/Documents/Local/spotx.bat
|
||||||
|
@ -138,12 +125,12 @@ else ifeq ($(WSL), 1)
|
||||||
@echo "(Windows) Scripts synced!"
|
@echo "(Windows) Scripts synced!"
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
# CSGO
|
# CSGO (only if installed)
|
||||||
@if [ -d $(CSGO) ]; then \
|
@if [ -d $(CSGO_CFG) ]; then \
|
||||||
$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/games/csgo/autoexec.cfg -O $(CSGO)/autoexec.cfg; \
|
$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/games/csgo/autoexec.cfg -O $(CSGO_CFG)/autoexec.cfg; \
|
||||||
$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/games/csgo/myconfig.cfg -O $(CSGO)/myconfig.cfg; \
|
$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/games/csgo/myconfig.cfg -O $(CSGO_CFG)/myconfig.cfg; \
|
||||||
$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/games/csgo/customgame.cfg -O $(CSGO)/customgame.cfg; \
|
$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/games/csgo/customgame.cfg -O $(CSGO_CFG)/customgame.cfg; \
|
||||||
$(foreach d,$(filter-out "userdata",$(shell find $(PFx86)/Steam/userdata -maxdepth 1 -type d -printf "\"%f\" ")), $(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/games/csgo/video.txt -O $(PFx86)/Steam/userdata/$(d)/730/local/cfg/video.txt;) \
|
$(foreach d,$(WIN_STEAM_USERDATA), $(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/games/csgo/video.txt -O $(PFx86)/Steam/userdata/$(d)/730/local/cfg/video.txt;) \
|
||||||
echo "(Windows) CS:GO synced!"; \
|
echo "(Windows) CS:GO synced!"; \
|
||||||
echo; \
|
echo; \
|
||||||
fi
|
fi
|
||||||
|
@ -152,7 +139,35 @@ else ifeq ($(WSL), 1)
|
||||||
@echo "(Windows) Firefox synced!"
|
@echo "(Windows) Firefox synced!"
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
# END
|
sync:
|
||||||
|
# Check if at least the platform is supported
|
||||||
|
ifneq (1, $(filter 1, $(ARCH) $(WSL)))
|
||||||
|
@echo "Unsupported platform"
|
||||||
|
else
|
||||||
|
|
||||||
|
# Call target of compatible with all supported platforms
|
||||||
|
@$(MAKE) sync-dotconfig
|
||||||
|
@$(MAKE) sync-dotfiles
|
||||||
|
@$(MAKE) sync-emacs
|
||||||
|
|
||||||
|
|
||||||
|
# Specific to Arch
|
||||||
|
ifeq ($(ARCH), 1)
|
||||||
|
@$(MAKE) sync-arch
|
||||||
|
|
||||||
|
@echo "Arch synced!"
|
||||||
|
@echo
|
||||||
|
|
||||||
|
# Specific to WSL
|
||||||
|
else ifeq ($(WSL), 1)
|
||||||
|
@$(MAKE) sync-wsl
|
||||||
|
|
||||||
|
@echo "WSL synced!"
|
||||||
|
@echo
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
@$(MAKE) sync-windows
|
||||||
|
|
||||||
@echo "Windows synced!"
|
@echo "Windows synced!"
|
||||||
@echo
|
@echo
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue