Admin check

This commit is contained in:
Mylloon 2024-10-02 20:22:09 +02:00
parent 7051a249e7
commit 9f2ab5509f
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -11,11 +11,6 @@ REPO_SRC = https://git.mylloon.fr/Anri/confOS/raw/branch/main
WGET = wget -q --show-progress WGET = wget -q --show-progress
CURL = curl -s 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 # Hide some verbose messages from Make
MAKEFLAGS += --no-print-directory 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\" ")) 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 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 all: full-sync
@ -206,6 +208,7 @@ sync-windows:
echo "$(WIN) CS2 configs synced!"; \ echo "$(WIN) CS2 configs synced!"; \
echo; \ echo; \
fi fi
# Firefox # Firefox
-@$(RM) $(APPDATA)/Mozilla/Firefox/Profiles/*.default-release/user.js -@$(RM) $(APPDATA)/Mozilla/Firefox/Profiles/*.default-release/user.js
@$(WGET) $(REPO_SRC)/.mozilla/firefox/user.js -P $(APPDATA)/Mozilla/Firefox/Profiles/*.default-release @$(WGET) $(REPO_SRC)/.mozilla/firefox/user.js -P $(APPDATA)/Mozilla/Firefox/Profiles/*.default-release
@ -238,8 +241,9 @@ sync-windows:
# @echo # @echo
# OBS config # 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 "$(WIN) Can't update OBS configuration, use elevated terminal to do so"
@echo
else else
@$(MKDIR) $(PF)/obs-studio/config/obs-studio/basic/profiles/ReplayBuffer @$(MKDIR) $(PF)/obs-studio/config/obs-studio/basic/profiles/ReplayBuffer
@$(MKDIR) $(PF)/obs-studio/config/obs-studio/basic/scenes @$(MKDIR) $(PF)/obs-studio/config/obs-studio/basic/scenes
@ -250,10 +254,15 @@ else
endif endif
# FanControl # FanControl
ifeq ($(ADMIN_WIN),1)
@echo "$(WIN) Can't update FanControl configuration, use elevated terminal to do so"
@echo
else
@$(MKDIR) $(PFx86)/FanControl/Configurations/ @$(MKDIR) $(PFx86)/FanControl/Configurations/
@$(WGET) $(REPO_SRC)/.config/FanControl/userConfig.json -O $(PFx86)/FanControl/Configurations/userConfig.json @$(WGET) $(REPO_SRC)/.config/FanControl/userConfig.json -O $(PFx86)/FanControl/Configurations/userConfig.json
@echo "$(WIN) FanControl configuration synced!" @echo "$(WIN) FanControl configuration synced!"
@echo @echo
endif
# Termux distro specific # Termux distro specific
sync-termux: sync-termux: