🧭 Migration: ML4W Hyprland → COSMIC Wayland (GDM, Arch Linux)
✅ Goal
Switch from ML4W Hyprland (SDDM) to a stable COSMIC desktop running Wayland, with clean login and no screen drift.
🧱 Environment Recap
| Layer | Final State | Notes |
|---|---|---|
| Display Manager | GDM | Clean separation between greeter & user session. |
| Session File | /usr/share/wayland-sessions/cosmic-manual.desktop | Launches COSMIC directly via dbus-run-session cosmic-session. |
| User Config | /var/lib/AccountsService/users/lwoodard | Set to XSession=cosmic-manual. |
| Compositor | cosmic-comp (reset) | Parallax & camera motion disabled. |
| Hyprland / ML4W | Still installed | Selectable manually via GDM gear. |
🪜 Final Working Procedure
1️⃣ Install and activate GDM
sudo pacman -S --needed gdm xdg-desktop-portal xdg-desktop-portal-gtk
sudo systemctl disable sddm
sudo systemctl enable --now gdm2️⃣ Create a manual COSMIC session
sudo tee /usr/share/wayland-sessions/cosmic-manual.desktop >/dev/null <<'EOF'
[Desktop Entry]
Name=COSMIC (manual Wayland)
Comment=Run COSMIC in a clean dbus-run-session
Type=Application
TryExec=/usr/bin/cosmic-session
Exec=/usr/bin/env XDG_SESSION_TYPE=wayland dbus-run-session cosmic-session
EOF3️⃣ Make GDM use it by default
sudo tee /etc/gdm/custom.conf >/dev/null <<'EOF'
[daemon]
WaylandEnable=true
DefaultSession=cosmic-manual.desktop
EOF4️⃣ Register it for the user (AccountsService)
echo -e "[User]\nXSession=cosmic-manual" | sudo tee /var/lib/AccountsService/users/$USER >/dev/null
sudo chown root:root /var/lib/AccountsService/users/$USER
sudo chmod 644 /var/lib/AccountsService/users/$USER5️⃣ Remove per-user overrides and restart GDM
rm -f ~/.dmrc
sudo systemctl restart accounts-daemon
sudo systemctl restart gdm🟢 Result: GDM logs directly into COSMIC Wayland.
🧹 Compositor Fix (“floating screen” bug)
Reset and disable camera/parallax
pkill -9 cosmic-comp
rm -f ~/.config/cosmic/cosmic-comp.toml
/usr/bin/cosmic-comp --reset-settings &
mkdir -p ~/.config/cosmic
cat > ~/.config/cosmic/cosmic-comp.toml <<'EOF'
[compositor]
enable_head_tracking = false
enable_parallax = false
camera_movement = false
EOF
nohup /usr/bin/cosmic-comp >/dev/null 2>&1 &🟢 Check:
Move your mouse — the desktop and panels should remain still.
🔍 Verification Checklist
| Check | Command | Expected Output |
|---|---|---|
| Current desktop | echo $XDG_CURRENT_DESKTOP | COSMIC |
| Session type | echo $XDG_SESSION_TYPE | wayland |
| Compositor active | pgrep cosmic-comp | PID shown |
| Parallax off | Inspect ~/.config/cosmic/cosmic-comp.toml | All false |
| GDM session file | cat /etc/gdm/custom.conf | DefaultSession=cosmic-manual.desktop |
🔁 Optional – Switch Back to Hyprland
To restore ML4W Hyprland as default:
sudo sed -i 's/cosmic-manual.desktop/hyprland.desktop/' /etc/gdm/custom.conf
echo -e "[User]\nXSession=hyprland" | sudo tee /var/lib/AccountsService/users/$USER >/dev/null
sudo systemctl restart gdmHyprland will appear normally under the GDM gear menu.
🧩 Summary
What worked:
- Switched display manager → GDM
- Created manual COSMIC session with
dbus-run-session - Updated AccountsService + GDM defaults
- Reset
cosmic-compconfig to disable motion
Result:
→ Boots cleanly into COSMIC Wayland
→ No Hyprlock interference
→ No screen drift or parallax
→ Still able to launch Hyprland manually when desired