fix installation block

This commit is contained in:
2026-05-13 23:14:52 +02:00
parent a8f2ec9d8c
commit 3e6685c542
+13 -9
View File
@@ -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"
if [ ! -d "$TARGET_DIR" ]; then
sudo mkdir -p "$TARGET_DIR"
fi
# 3. Create the .desktop file
cat <<EOF | sudo tee $TARGET_FILE > /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."