minor fix

This commit is contained in:
js0ny 2025-03-02 17:50:23 +00:00
parent 6a84917074
commit e7e193d41b

View file

@ -27,11 +27,24 @@ IS_WSL=0
WINDOWS_USER="" WINDOWS_USER=""
PACKAGE_MANAGER="" PACKAGE_MANAGER=""
# WSL detection
# NOTE: This is NOT a POSIX-compliant way, for POSIX-compliant way, use case/esac # NOTE: This is NOT a POSIX-compliant way, for POSIX-compliant way, use case/esac
if [[ "$(uname -r)" = *Microsoft* ]]; then if [[ "$(uname -r)" = *icrosoft* ]]; then
echo "[INFO] Running on WSL1 Skipping GUI setup" echo "[INFO] Running on WSL"
IS_WSL=1
WINDOWS_USER="$(cmd.exe /c "echo %USERNAME%" | tr -d '\r')" WINDOWS_USER="$(cmd.exe /c "echo %USERNAME%" | tr -d '\r')"
IS_WSL=1
fi
if [ "$IS_WSL" -eq 1 ]; then
if [[ "$(uname -r)" = *Microsoft* ]]; then
IS_WSL=1
elif [[ "$(uname -r)" = *microsoft* ]]; then
IS_WSL=2
fi
fi
if [ "$IS_WSL" -eq 1 ]; then
echo "[INFO] Running on WSL1 Skipping GUI setup"
else else
read -p "[ACTION] Do you want to setup Linux GUI? (y/N) " -r choice read -p "[ACTION] Do you want to setup Linux GUI? (y/N) " -r choice
case "$choice" in case "$choice" in
@ -60,7 +73,16 @@ if [ "$WHEEL" -eq 1 ]; then
PACKAGE_MANAGER="pacman" PACKAGE_MANAGER="pacman"
else else
echo "[ERROR] Unsupported package manager" echo "[ERROR] Unsupported package manager"
exit 1 read -p "[ACTION] Do you still want to continue? (y/N) " -r choice
case "$choice" in
y | Y)
:
;;
*)
echo "[ERROR] Exiting"
exit 1
;;
esac
fi fi
fi fi
@ -135,7 +157,6 @@ echo "[INFO] Installing Doom Emacs"
source "$DOTFILES"/bootstrap/components/emacs.sh source "$DOTFILES"/bootstrap/components/emacs.sh
# TODO: Untestest
if [ "$IS_WSL" -eq 1 ]; then if [ "$IS_WSL" -eq 1 ]; then
ln -sf "/mnt/c/Users/$WINDOWS_USER" "$HOME/winhome" ln -sf "/mnt/c/Users/$WINDOWS_USER" "$HOME/winhome"
ln -sf "/mnt/c/Users/$WINDOWS_USER/Downloads" "$HOME/Downloads" ln -sf "/mnt/c/Users/$WINDOWS_USER/Downloads" "$HOME/Downloads"
@ -159,7 +180,6 @@ source "$DOTFILES"/bootstrap/linux/chromium-flags.bash
source "$DOTFILES"/bootstrap/components/rime.sh source "$DOTFILES"/bootstrap/components/rime.sh
# TODO: Rewrite the script(mocha_port.fish) in bash/zsh or POSIX-compliant shell
echo "[INFO] Installing Color Scheme (Catppuccin Mocha)" echo "[INFO] Installing Color Scheme (Catppuccin Mocha)"
# fish $DOTFILES/bootstrap/temp/mocha_port.fish # fish $DOTFILES/bootstrap/temp/mocha_port.fish