Skip to content

Latest commit

 

History

History
72 lines (59 loc) · 3.04 KB

File metadata and controls

72 lines (59 loc) · 3.04 KB

Development

Notes for people who want to work on Moonrice itself.

Layout

install.sh                      # the installer (plan table + generators)
bin/moonrice                    # post-install management CLI
bin/palettes.json               # palette variants (moon / main / dawn)
scripts/lint.sh                 # local + CI lint
config/                         # mirrors ~/.config
  hypr/                         # hyprland.lua, keymap.lua, modules, scripts, lock/idle
  hyprland/colors.conf          # window borders + hyprbars (themed)
  caelestia/
    config.json                 # → ~/.config/illogical-impulse/config.json
    generated/                  # pinned material palette (colors.json, scss, sequences)
    wallpapers/                 # pack → ~/.local/share/moonrice/wallpapers/
  kitty/ swaync/ btop/ rofi/ nvim/ starship.toml fastfetch/ fontconfig/
  cmus/ lazygit/ yazi/ fetchx/
home/                           # $HOME root files (.zshrc, .tmux.conf)
docs/                           # the wiki (mkdocs)

The installer's data flow

  1. detect_monitors() reads the live layout via hyprctl → MONITORS.
  2. generate_monitor_config() writes monitors.conf + custom/rules.conf (workspace pinning) — falls back to shipped defaults without a session.
  3. sync_keybinds() builds the final keybinds: staged file → adapt_keybinds (comment out missing tools) → monitor-focus block → compare → install.
  4. patch_home_paths() rewrites the author's /home/swadhin to $HOME; the PLAN loop compares normalized content so re-runs are clean.
  5. Theme files are written to ~/.local/state/quickshell/user/generated/ (Caelestia hot-reloads them).
  6. Cursor build (Bibata-Material-Rose-Pine) and TPM clone are one-shot, skip-safe steps.

Palette switching (bin/moonrice)

moonrice palette set <variant>:

  • regenerates the Caelestia material theme from bin/palettes.json (same role mapping the installer's generator uses),
  • re-hexes every file in the CLI's targets set via a variant-wide old-hex→new-hex map,
  • swaps the vivid theme name in .zshrc for LS_COLORS.

Adding a variant: extend bin/palettes.json (roles + ansi + vivid name). Derived roles (darker/low/high/*Dim/*Container) must be present for the material generation.

Testing without touching your system

HOME=/tmp/fakehome bash install.sh --apply --skip-cursor   # full run
HOME=/tmp/fakehome bash install.sh --apply --skip-cursor   # again: expect 0 written
HOME=/tmp/fakehome bash install.sh --rollback <stamp>
HOME=/tmp/fakehome bash bin/moonrice doctor
bash scripts/lint.sh

The CI runs the same smoke test in an archlinux container.

Gotchas

  • set -euo pipefail — a failing [ x ] && cmd at the end of a function kills the script; use if blocks there.
  • The wallpaper is always installed as moonrice.jpg; the staged config.json points at /home/swadhin/Pictures/Wallpapers/moonrice.jpg and gets rewritten to $HOME at install.
  • Monitor names are machine-specific — never hardcode them; the generator owns them.