Add transform script for existing Arch+Wayland systems

Extract shared helpers into lib.sh (log, err, confirm, path constants)
and refactor post-install.sh + update.sh to source it.

New transform.sh converts an existing Arch+Wayland system to Moonarch:
pre-flight summary, config backup, DM conflict resolution, PulseAudio
removal, full package install, and hard overwrite of all configs.

Also migrate kanshi from niri spawn-at-startup to systemd user service.
This commit is contained in:
2026-03-29 15:03:44 +02:00
parent 24d70db2cf
commit 9d26f04af6
7 changed files with 489 additions and 62 deletions
+38 -5
View File
@@ -35,7 +35,7 @@ desktop that can be rebuilt from scratch in minutes.
## Quick Start
### Install
### Fresh Install (Bare Metal)
1. Boot the [Arch ISO](https://archlinux.org/download/) and download the config:
```bash
@@ -53,6 +53,28 @@ The archinstall config clones this repo to `/opt/moonarch` via custom-commands.
post-install.sh handles the remaining ~100 packages, all configs, themes, services,
and user setup.
### Transform (Existing Arch+Wayland System)
Already running Arch with a Wayland compositor (Sway, Hyprland, GNOME Wayland, etc.)?
Transform converts your system to Moonarch without reinstalling.
**Prerequisites:** Active Wayland session, git installed.
```bash
git clone https://gitea.moonarch.de/nevaforget/moonarch.git /opt/moonarch
/opt/moonarch/scripts/transform.sh
```
The script will:
1. Show a pre-flight summary of all changes
2. Back up your `~/.config/`, `~/.zshrc`, and `/etc/xdg/` to timestamped tar archives
3. Disable conflicting display managers (SDDM, GDM, LightDM, etc.)
4. Remove conflicting packages (e.g. PulseAudio → PipeWire)
5. Install all Moonarch packages and configs (**hard overwrite** of all user configs)
6. Enable greetd, firewall, and system services
After completion, **reboot** (do not log out — your previous DM is already disabled).
### Update
```bash
@@ -74,7 +96,9 @@ packages/
aur.txt AUR packages (~15), one per line
scripts/
lib.sh Shared helpers sourced by all scripts
post-install.sh Main automation (packages, configs, themes, services)
transform.sh Convert existing Arch+Wayland system to Moonarch
install-themes.sh Cursor theme installer (Sweet-cursors)
update.sh System updater (symlinked to moonarch-update)
@@ -113,6 +137,7 @@ defaults/
shell/zshrc Zsh config: prompt, aliases, FZF, completion
etc/greetd/ greetd daemon + greeter Niri config
etc/moongreet/ moongreet configuration
user/systemd/user/ Systemd user services (kanshi)
user/waybar/ Per-user Waybar overrides (only copied if missing)
backgrounds/wallpaper.jpg Default wallpaper (shared by desktop, greeter, lock screen)
```
@@ -125,10 +150,12 @@ greetd ─► niri (greeter instance) ─► moongreet ─► user authenticates
niri (user session)
┌─────────┬──────────┬────────────────┬──────────┐
▼ ▼ ▼ ▼
kanshi waybar dunst foot waypaper cliphist
(outputs) (bar) (notify) (server) (wallpaper) (clipboard)
┌──────────┬────────────────┬──────────┐
▼ ▼ ▼ ▼ ▼
waybar dunst foot waypaper cliphist
(bar) (notify) (server) (wallpaper) (clipboard)
kanshi runs as a systemd user service (graphical-session.target)
```
## Keybinds (Default)
@@ -186,6 +213,12 @@ are part of the system and updated via `moonarch-update`.
| ufw | Firewall (deny incoming, allow outgoing) |
| auto-cpufreq | CPU frequency scaling (AC: performance, battery: powersave) |
### User Services (systemd --user)
| Service | Purpose |
|---------|---------|
| kanshi | Dynamic display configuration (auto-switch output profiles on hotplug) |
## Moonarch Ecosystem
Moonarch is the deployment and configuration layer. Three companion projects provide