From 9f2ab5509f6897355f543a52a95ae5bf583eb33a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 2 Oct 2024 20:22:09 +0200 Subject: [PATCH] Admin check --- Makefile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3e5dd8e..ead3943 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,6 @@ REPO_SRC = https://git.mylloon.fr/Anri/confOS/raw/branch/main WGET = wget -q --show-progress CURL = curl -s -# Checkers -ARCH = $(shell grep -c "archlinux" /proc/version 2> /dev/null) -WSL = $(shell grep -c "WSL2" /proc/version 2> /dev/null) -TERMUX = $(firstword $(shell type termux-info &> /dev/null && echo 1)) - # Hide some verbose messages from Make MAKEFLAGS += --no-print-directory @@ -29,6 +24,13 @@ LOCALAPPDATA = $(WIN_HOME)/AppData/Local WIN_STEAM_USERDATA = $(filter-out "userdata",$(shell find $(PFx86)/Steam/userdata -maxdepth 1 -type d -printf "\"%f\" ")) CS2_CFG = $(PFx86)/Steam/steamapps/common/Counter-Strike\ Global\ Offensive/game/csgo/cfg +# Checkers +ARCH = $(shell grep -c "archlinux" /proc/version 2> /dev/null) +WSL = $(shell grep -c "WSL2" /proc/version 2> /dev/null) +TERMUX = $(firstword $(shell type termux-info &> /dev/null && echo 1)) +ADMIN_WIN = $(shell touch $(PF) 2> /dev/null; echo $$?) + + all: full-sync @@ -206,6 +208,7 @@ sync-windows: echo "$(WIN) CS2 configs synced!"; \ echo; \ fi + # Firefox -@$(RM) $(APPDATA)/Mozilla/Firefox/Profiles/*.default-release/user.js @$(WGET) $(REPO_SRC)/.mozilla/firefox/user.js -P $(APPDATA)/Mozilla/Firefox/Profiles/*.default-release @@ -238,8 +241,9 @@ sync-windows: # @echo # OBS config -ifeq ($(shell touch $(PF) 2> /dev/null; echo $$?),1) +ifeq ($(ADMIN_WIN),1) @echo "$(WIN) Can't update OBS configuration, use elevated terminal to do so" + @echo else @$(MKDIR) $(PF)/obs-studio/config/obs-studio/basic/profiles/ReplayBuffer @$(MKDIR) $(PF)/obs-studio/config/obs-studio/basic/scenes @@ -250,10 +254,15 @@ else endif # FanControl +ifeq ($(ADMIN_WIN),1) + @echo "$(WIN) Can't update FanControl configuration, use elevated terminal to do so" + @echo +else @$(MKDIR) $(PFx86)/FanControl/Configurations/ @$(WGET) $(REPO_SRC)/.config/FanControl/userConfig.json -O $(PFx86)/FanControl/Configurations/userConfig.json @echo "$(WIN) FanControl configuration synced!" @echo +endif # Termux distro specific sync-termux: