🧭 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

LayerFinal StateNotes
Display ManagerGDMClean separation between greeter & user session.
Session File/usr/share/wayland-sessions/cosmic-manual.desktopLaunches COSMIC directly via dbus-run-session cosmic-session.
User Config/var/lib/AccountsService/users/lwoodardSet to XSession=cosmic-manual.
Compositorcosmic-comp (reset)Parallax & camera motion disabled.
Hyprland / ML4WStill installedSelectable 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 gdm

2️⃣ 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
EOF

3️⃣ Make GDM use it by default

sudo tee /etc/gdm/custom.conf >/dev/null <<'EOF'
[daemon]
WaylandEnable=true
DefaultSession=cosmic-manual.desktop
EOF

4️⃣ 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/$USER

5️⃣ 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

CheckCommandExpected Output
Current desktopecho $XDG_CURRENT_DESKTOPCOSMIC
Session typeecho $XDG_SESSION_TYPEwayland
Compositor activepgrep cosmic-compPID shown
Parallax offInspect ~/.config/cosmic/cosmic-comp.tomlAll false
GDM session filecat /etc/gdm/custom.confDefaultSession=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 gdm

Hyprland 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-comp config 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