#!/bin/bash # Fresh Hyprland Setup - Remove Deepin, Install Hyprland + SDDM set -e RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' echo -e "${YELLOW}=== Fresh Hyprland Setup ===${NC}" # Check root if [[ $EUID -ne 0 ]]; then echo -e "${RED}Run with sudo${NC}" exit 1 fi # Get the actual user (not root) ACTUAL_USER="${SUDO_USER:-$USER}" USER_HOME=$(eval echo ~$ACTUAL_USER) echo -e "${YELLOW}[1/6] Removing Deepin and other DEs...${NC}" pacman -Rns --noconfirm deepin deepin-extra lightdm lightdm-deepin-greeter 2>/dev/null || true pacman -Rns --noconfirm plasma-desktop gnome-shell xfce4-session gdm 2>/dev/null || true echo -e "${YELLOW}[2/6] Removing old Hyprland configs...${NC}" rm -rf "$USER_HOME/.config/hypr" rm -rf "$USER_HOME/.config/waybar" rm -rf "$USER_HOME/.config/wofi" rm -rf "$USER_HOME/.cache/hyprland" echo -e "${YELLOW}[3/6] Installing SDDM...${NC}" pacman -S --needed --noconfirm sddm echo -e "${YELLOW}[4/6] Installing Hyprland and essentials...${NC}" pacman -S --needed --noconfirm \ hyprland \ kitty \ waybar \ wofi \ swaybg \ swaylock \ wlogout \ xdg-desktop-portal-hyprland \ qt5-wayland \ qt6-wayland \ polkit-kde-agent \ dunst \ pipewire \ wireplumber \ pipewire-pulse echo -e "${YELLOW}[5/6] Configuring SDDM...${NC}" systemctl disable lightdm gdm 2>/dev/null || true systemctl enable sddm echo -e "${YELLOW}[6/6] Creating basic Hyprland config...${NC}" mkdir -p "$USER_HOME/.config/hypr" cat > "$USER_HOME/.config/hypr/hyprland.conf" << 'EOF' # Hyprland Config monitor=,preferred,auto,1 exec-once = waybar exec-once = dunst exec-once = /usr/lib/polkit-kde-authentication-agent-1 input { kb_layout = us follow_mouse = 1 touchpad { natural_scroll = true } } general { gaps_in = 5 gaps_out = 10 border_size = 2 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) layout = dwindle } decoration { rounding = 10 blur { enabled = true size = 3 passes = 1 } drop_shadow = true shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) } animations { enabled = true bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } dwindle { pseudotile = true preserve_split = true } # Keybinds $mainMod = SUPER bind = $mainMod, RETURN, exec, kitty bind = $mainMod, Q, killactive, bind = $mainMod, M, exit, bind = $mainMod, E, exec, dolphin bind = $mainMod, V, togglefloating, bind = $mainMod, D, exec, wofi --show drun bind = $mainMod, P, pseudo, bind = $mainMod, J, togglesplit, # Move focus bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d # Switch workspaces bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 # Move window to workspace bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Mouse bindings bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow EOF chown -R $ACTUAL_USER:$ACTUAL_USER "$USER_HOME/.config/hypr" echo -e "${GREEN}=== Setup Complete! ===${NC}" echo -e "${YELLOW}Keybinds:${NC}" echo " SUPER + RETURN = Terminal" echo " SUPER + D = App Launcher" echo " SUPER + Q = Close Window" echo " SUPER + M = Exit Hyprland" echo "" echo -e "${GREEN}Reboot to use Hyprland!${NC}" read -p "Reboot now? (y/n): " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then reboot fi