Skip to content

feat(setup): add terminal setup recipe#165

Open
yukazakiri wants to merge 1 commit into
snowarch:mainfrom
yukazakiri:feat/setup-terminals-recipe
Open

feat(setup): add terminal setup recipe#165
yukazakiri wants to merge 1 commit into
snowarch:mainfrom
yukazakiri:feat/setup-terminals-recipe

Conversation

@yukazakiri

Copy link
Copy Markdown
Contributor

Summary

Adds a new interactive /setup-terminals recipe that lets users install a terminal emulator and automatically sets it as the iNiR default.

Problem

Currently there is no setup recipe for terminal emulators. Users must manually install their preferred terminal and update config.json to set it as the default for Mod+T / Mod+Return keybinds.

Changes

New file: scripts/setup/terminals.sh

  • Interactive menu — choose from 6 terminal emulators:
    • Kitty, Foot, Alacritty, WezTerm, Ghostty, Konsole
  • Distro-aware installation:
    • Arch: installs via install_arch (repo + AUR support)
    • Non-Arch: falls back to Flatpak when available
  • Auto-configures iNiR defaults — updates config.json:
    • apps.terminal → selected terminal key
    • apps.update<terminal> -e arch-update
  • Safe config editing — uses jq with atomic temp-file + mv
  • Symlink-aware — resolves symlink targets before overwriting
  • Developer-friendly:
    • Clear section comments
    • Consistent error handling (holds terminal open on failure)
    • Easy to add new terminals (just append to the TERMINALS table)

Design

Follows the existing setup recipe pattern (spotify.sh, editors.sh):

  • Metadata header for auto-discovery by _scan.sh
  • setup_init / setup_progress / setup_done / setup_finish_pause flow
  • Phase-based functions for maintainability

Testing

  • bash -n scripts/setup/terminals.sh — syntax clean
  • bash scripts/setup/_scan.sh | jq '.[] | select(.slug == "terminals")' — discovered correctly
  • Menu renders to stderr, index returned on stdout
  • Cancel option exits gracefully with "No changes made"

Related

  • Plan: docs/superpowers/plans/2026-05-24-setup-terminals-recipe.md

- interactive menu for 6 terminal emulators (kitty, foot, alacritty, wezterm, ghostty, konsole)

- Arch: repo → AUR → Flatpak fallback chain

- Fedora: dnf → Flatpak fallback chain

- auto-updates config.json apps.terminal and apps.update

- developer-friendly: clear comments, TRACE=1 support, easy to extend
@yukazakiri yukazakiri force-pushed the feat/setup-terminals-recipe branch from 3166fe4 to 339d6d5 Compare May 24, 2026 12:58
@yukazakiri

yukazakiri commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

Updated this PR to simplify distro support:

  • Only Arch and Fedora are supported natively (no Debian/openSUSE/Void)
  • Arch fallback chain: official repo → AUR → Flatpak → error
  • Fedora fallback chain: dnf → Flatpak → error
  • All distro-specific logic is self-contained in terminals.sh

This keeps the recipe focused and maintainable.

@snowarch

Copy link
Copy Markdown
Owner

Thanks @yukazakiri — clean, additive recipe that follows the existing setup pattern. Queued for an install test before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants