From 3e6685c542e7ffb8e19a159cbf02a7b7e36a77c4 Mon Sep 17 00:00:00 2001 From: "yuri.kuit" Date: Wed, 13 May 2026 23:14:52 +0200 Subject: [PATCH] fix installation block --- v2/arch-chadwm.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/v2/arch-chadwm.sh b/v2/arch-chadwm.sh index 6d61111..befe94c 100755 --- a/v2/arch-chadwm.sh +++ b/v2/arch-chadwm.sh @@ -88,7 +88,7 @@ say_yellow "Starting Chadwm setup..." CURRENT_DE="$(detect_de)" CURRENT_DM="$(detect_display_manager)" -CURRENT_USER=$(whoami) +REAL_USER=${SUDO_USER:-$(whoami)} if [[ -z "$CURRENT_DE" ]]; then say_cyan -e "No Desktop Environment detected. Installing Chadwm (light setup with SDDM)..." @@ -96,24 +96,28 @@ if [[ -z "$CURRENT_DE" ]]; then install_packages sddm picom feh acpi rofi dash imlib2 xsetroot enable_graphical_target - git clone https://github.com/siduck/chadwm --depth 1 ~/.config/chadwm - cd ~/.config/chadwm/ - mv eww ~/.config - cd chadwm + git clone https://github.com/siduck/chadwm --depth 1 "/home/$REAL_USER/.config/chadwm" + + cd "/home/$REAL_USER/.config/chadwm/chadwm" sudo make install - # create .desktop file - TARGET_FILE="/usr/share/xsessions/chadwm.desktop" + # 2. Ensure the target directory actually exists + TARGET_DIR="/usr/share/xsessions" + TARGET_FILE="$TARGET_DIR/chadwm.desktop" -cat < /dev/null + if [ ! -d "$TARGET_DIR" ]; then + sudo mkdir -p "$TARGET_DIR" + fi + + # 3. Create the .desktop file + cat < /dev/null [Desktop Entry] Name=chadwm Comment=dwm made beautiful -Exec=/home/$CURRENT_USER/.config/chadwm/scripts/run.sh +Exec=/home/$REAL_USER/.config/chadwm/scripts/run.sh Type=Application EOF - # Set appropriate permissions sudo chmod 644 $TARGET_FILE say_green -e "Chadwm with SDDM installed successfully. You can reboot now to start Chadwm."