Skip to content

Conversation

@aradanmn
Copy link

No description provided.

aradanmn and others added 29 commits January 23, 2026 17:10
…pport

- Add modules/version_info.sh for centralized version and repo constants
- Add modules/launcher_detection.sh for AppImage/Flatpak launcher detection
- Add modules/launcher_script_generator.sh with heredoc template
- Update install-minecraft-splitscreen.sh to use new modules and repo URL
- Update modules/main_workflow.sh with launcher generation phase
- Update modules/pollymc_setup.sh with Flatpak detection and dynamic paths
- Update modules/launcher_setup.sh with Flatpak PrismLauncher support
- Remove static minecraftSplitscreen.sh (now auto-generated)

The installer now:
- Detects existing Flatpak or AppImage installations
- Auto-generates minecraftSplitscreen.sh with correct paths baked in
- Includes version metadata (version, commit hash, generation date)
- Supports both PollyMC and PrismLauncher in AppImage and Flatpak formats
- Uses aradanmn/MinecraftSplitscreenSteamdeck as the source repo
…ation method

- Update repo URLs from FlyingEwok to aradanmn fork
- Add new features: auto-generated launcher, Flatpak support, version tracking
- Update installation commands to use curl | bash method
- Add Installation Locations section for both AppImage and Flatpak
- Update Uninstall section with Flatpak paths
- Add new technical improvements for launcher detection module
- Add recent improvements for new features
…ING_MODE

- Fix SCRIPT_DIR detection to handle piped execution where BASH_SOURCE is empty
- Remove unused TESTING_MODE variable check
- Simplify entry point to always call main()
When running via 'curl | bash', stdin is consumed by the pipe.
User prompts now read from /dev/tty to get actual keyboard input.

Fixed prompts:
- Minecraft version selection
- Custom version input
- Mod selection
- Steam integration prompt
- Desktop launcher prompt
Use printf for prompt text instead of read -p, since read -p writes
to stderr which doesn't display properly when stdin is redirected
from /dev/tty.
This is a major refactor that fixes the path handling chaos by creating
a single source of truth for all launcher paths:

NEW: modules/path_configuration.sh
- Defines all base paths (AppImage and Flatpak directories)
- Provides CREATION_* variables for instance creation phase
- Provides ACTIVE_* variables for gameplay phase
- Functions: configure_launcher_paths(), set_creation_launcher_prismlauncher(),
  set_active_launcher_pollymc(), finalize_launcher_paths()
- Accessor functions: get_creation_instances_dir(), get_active_instances_dir(),
  get_launcher_script_path(), etc.

UPDATED MODULES:
- install-minecraft-splitscreen.sh: Load path_configuration.sh, remove hardcoded paths
- main_workflow.sh: Call configure_launcher_paths() first, use ACTIVE_* variables
- instance_creation.sh: Use CREATION_INSTANCES_DIR instead of hardcoded paths
- launcher_setup.sh: Use centralized paths, call set_creation_launcher_prismlauncher()
- pollymc_setup.sh: Use centralized paths, call set_active_launcher_pollymc()
- steam_integration.sh: Use ACTIVE_LAUNCHER_SCRIPT for shortcut creation
- desktop_launcher.sh: Use ACTIVE_* variables for paths and script location

This fixes issues where:
- Instances were created in wrong directory for Flatpak installations
- Launcher script was generated with incorrect paths
- Desktop/Steam shortcuts pointed to wrong locations
- PollyMC migration failed due to path mismatches
launcher_detection.sh already does this.
launcher_detection.sh as both scripts were accomplishing same
functionality.
launcher location, added logic to account manager to add player account
instead of overwriting accounts.json.
- Add revert_to_prismlauncher() function to restore ACTIVE_* variables
- Fix download failure handling to clean up partial files and return early
- Add validation to detect invalid downloads (empty files, HTML error pages)
- Replace incorrect set_creation_launcher_prismlauncher call with revert_to_prismlauncher
- Add explicit revert when PollyMC compatibility test fails

The PollyMC repo (fn2006/PollyMC) is no longer available (404), so the
fallback to PrismLauncher is now the expected behavior until an alternative
launcher URL is configured (e.g., FjordLauncherUnlocked).
… directory

- PrismLauncher download now detects system architecture (uname -m) and
  downloads matching AppImage (x86_64 vs aarch64) instead of always
  getting the first one alphabetically (which was aarch64)
- Clean up empty PollyMC data directory when download fails or produces
  invalid file, using rmdir to only remove if actually empty
- Add is_immutable_os() to detect Bazzite, SteamOS, Fedora Silverblue/Kinoite,
  Universal Blue variants, NixOS, openSUSE MicroOS, Endless OS, and other
  ostree-based distributions
- Add should_prefer_flatpak() helper function
- Update PrismLauncher setup to install Flatpak from Flathub on immutable
  systems instead of downloading AppImage
- Flatpak is installed as user (--user) to avoid requiring root
- Falls back to AppImage if Flatpak installation fails

This follows best practices for immutable/atomic Linux distributions where
Flatpak is the preferred application format.
…le-os

feat: Prefer Flatpak installation on immutable Linux systems
…n-immutable-os

Revert "feat: Prefer Flatpak installation on immutable Linux systems"
- Add full JSDoc headers to 8 modules (mod_management, java_management,
  lwjgl_management, desktop_launcher, launcher_script_generator,
  steam_integration, main_workflow, version_management)
- Document all functions with @function, @param, @global, @return tags
- Standardize documentation format across all modules
- path_configuration.sh (v1.2.0): Set PREFER_FLATPAK and IMMUTABLE_OS_DETECTED
  once in configure_launcher_paths(), used by all modules
- launcher_setup.sh (v2.2.0): Use PREFER_FLATPAK variable instead of
  calling should_prefer_flatpak()
- pollymc_setup.sh (v1.3.0): Add Flatpak installation logic for immutable OS;
  installs PollyMC via Flatpak before falling back to AppImage download

On immutable OS (Bazzite, SteamOS, etc.), Flatpak is now properly
installed when no existing installation is found.
- path_configuration.sh (v1.2.1): Remove premature mkdir in configure_launcher_paths()
  detection phase; directories created later by actual install functions
- launcher_setup.sh (v2.2.1): Download AppImage to temp file first, only create
  directory after successful download
- pollymc_setup.sh (v1.3.1): Same pattern - download to temp, create dir on success

Fixes issue where empty PollyMC/PrismLauncher directories were created
even when using Flatpak or when download failed.
…ent variable

- Add parse_github_raw_url() to extract owner/repo/branch from GitHub raw URLs
- Add detect_source_url() with three detection methods:
  1. --source-url argument for curl | bash -s -- --source-url URL
  2. INSTALLER_SOURCE_URL environment variable
  3. Local git remote and current branch detection
- Fall back to defaults (aradanmn/MinecraftSplitscreenSteamdeck/main) when undetectable
- Update header with usage examples for forks and branches
On Bazzite/SteamOS, Flathub is configured as a system-only remote.
The previous code tried --user install first which fails with
'No remote refs found for flathub'.

Now tries system-level install first (which works on Bazzite/SteamOS),
then falls back to user-level install if that fails.
Separate interrupt handler from cleanup function so Ctrl+C
actually exits the script instead of just running cleanup
and continuing.
Create detailed documentation for AI assistants working on this codebase:
- Project overview and hybrid launcher architecture
- Repository structure and module dependencies
- Code conventions (bash standards, naming, documentation)
- Path configuration system (critical for development)
- External APIs and their purposes
- Development commands and common tasks
- Pitfalls to avoid and debugging tips

Also update .gitignore to include CLAUDE.md in tracked files.
Document issues discovered during Steam Deck testing:
1. Centralized user input handling for curl | bash mode (HIGH)
2. Steam Deck virtual controller detection edge case (MEDIUM)
3. Logging system for multi-machine debugging (MEDIUM)
4. Minecraft new versioning system support (LOW/Future)

Include implementation patterns and recommended order.
Implement Issue #3 (Logging) and partial Issue #1 (User Input):

Logging System:
- Add init_logging() to create timestamped log files
- All print_* functions now auto-log (no duplicate log calls needed)
- log() function for debug-only info (doesn't print to terminal)
- Log location: ~/.local/share/MinecraftSplitscreen/logs/
- Auto-rotation keeps last 10 logs per type
- Logs system info at startup (OS, kernel, environment)

User Input Handling:
- Add prompt_user() that works with curl | bash mode
- Reopens /dev/tty when stdin is consumed by pipe
- Add prompt_yes_no() helper function
- Modules still need refactoring to use these functions

Generated Launcher Script:
- Add log_info(), log_error(), log_warning() functions
- Replace existing echo "[Info/Error/Warning]" patterns
- Creates launcher-*.log files for runtime debugging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Refactor all modules to use prompt_user() and prompt_yes_no() from
utilities.sh instead of raw read commands. This ensures proper input
handling when running via curl | bash by reopening /dev/tty.

Modules updated:
- version_management.sh: Minecraft version selection prompts
- mod_management.sh: Mod selection prompt
- steam_integration.sh: Steam integration yes/no prompt
- desktop_launcher.sh: Desktop launcher yes/no prompt

Also updates CLAUDE.md to mark Issue #1 as implemented.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants