Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbee36fc3a | ||
|
|
176503ab1b | ||
|
|
40803a7162 | ||
|
|
fbafaed846 | ||
|
|
17c1f0f77d | ||
|
|
aafc97ee58 | ||
|
|
e4224e27d0 | ||
|
|
fbb974fa19 | ||
|
|
0bfaff29ff | ||
|
|
8d910398bb | ||
|
|
83a65abb38 | ||
|
|
abf45a54d9 | ||
|
|
f0a731589a | ||
|
|
b991dd30d2 | ||
|
|
1787d56aeb | ||
|
|
b3ac639b45 | ||
|
|
db508a46cd | ||
|
|
b617aa6ea6 | ||
|
|
362feb044f | ||
|
|
03e72a8263 | ||
|
|
ae37f1a71f | ||
|
|
2ecc0240f9 | ||
|
|
1454407da4 | ||
|
|
1d9ab477db | ||
|
|
d0240d1408 | ||
|
|
647e97a105 | ||
|
|
c86edee113 | ||
|
|
1f7858e1fa | ||
|
|
efc5f20b5b | ||
|
|
9b454388f5 | ||
|
|
2c86ca3b21 | ||
|
|
93b1f0ad2d | ||
|
|
5f1fc591f9 | ||
|
|
be86f1e916 | ||
|
|
be63211e6b | ||
|
|
5316c5c113 | ||
|
|
dce6a39fee | ||
|
|
e985305929 |
No files matched your search
@@ -0,0 +1,81 @@
|
|||||||
|
---
|
||||||
|
name: linux-game-manager-dev
|
||||||
|
description: Develop and maintain Linux Game Manager in this repository. Use when adding or removing games, editing `.install`/`.launch`/`.update` scripts, changing `linux-game-manager.sh` installer/launcher/removal/update/CLI behavior, validating accessibility-sensitive flows, or refreshing project-local skill docs after functionality changes.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Linux Game Manager Development
|
||||||
|
|
||||||
|
Use this skill to make safe, consistent changes to Linux Game Manager and keep the skill accurate as the codebase evolves.
|
||||||
|
|
||||||
|
## Fast Routing
|
||||||
|
|
||||||
|
1. If the task adds/removes/changes a game, read `references/game-extension.md`.
|
||||||
|
2. If the task changes orchestration/CLI/config behavior, read `references/core-map.md`.
|
||||||
|
3. If the task changes behavior and you are updating this skill, read `references/skill-maintenance.md`.
|
||||||
|
4. Run `python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py` before and after major game-catalog changes.
|
||||||
|
|
||||||
|
## Core Workflow
|
||||||
|
|
||||||
|
1. Inspect relevant behavior and identify affected surfaces (`.install`, `.launch`, `.update`, `linux-game-manager.sh`, `speech`, docs).
|
||||||
|
2. Implement with existing patterns and helper functions instead of inventing new flows.
|
||||||
|
3. Validate runtime behavior with CLI/manual checks:
|
||||||
|
- `./linux-game-manager.sh -i`
|
||||||
|
- `./linux-game-manager.sh -r`
|
||||||
|
- `./linux-game-manager.sh -u`
|
||||||
|
- `./linux-game-manager.sh -t`
|
||||||
|
4. Validate catalog consistency:
|
||||||
|
- `python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py`
|
||||||
|
5. If bash files were edited:
|
||||||
|
- Verify `shellcheck` is installed.
|
||||||
|
- If missing, stop and prompt the user to install it (see `references/tooling-prereqs.md`).
|
||||||
|
- Run shellcheck on edited files and fix all reported errors.
|
||||||
|
6. If functionality changed, refresh this skill using `references/skill-maintenance.md`.
|
||||||
|
|
||||||
|
## Non-Negotiable Rules
|
||||||
|
|
||||||
|
1. Keep installer and launcher base filenames identical:
|
||||||
|
- `.install/<Game Name>.sh`
|
||||||
|
- `.launch/<Game Name>.game`
|
||||||
|
2. Ensure launcher scripts include a concrete `installPath`-based path so removal can locate game data.
|
||||||
|
3. Define `run_update()` in any `.update/<Game>.sh` script.
|
||||||
|
4. Preserve accessibility-first interaction:
|
||||||
|
- Keep dialog/yad wrapper usage (`ui_*` helpers) consistent.
|
||||||
|
- Do not introduce keyboard traps.
|
||||||
|
- For GUI applications, do not add new `speech-dispatcher`/`spd-say` dependencies.
|
||||||
|
5. Keep new script variables camelCase, function names snake_case, class names PascalCase.
|
||||||
|
6. For ambiguous "disable game" requests, default to disabling installer visibility only and preserve launcher playability unless the user explicitly requests complete disable.
|
||||||
|
|
||||||
|
## Required Validation
|
||||||
|
|
||||||
|
1. Run catalog audit:
|
||||||
|
- `python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py`
|
||||||
|
2. Run manual command checks relevant to change scope:
|
||||||
|
- install flow: `./linux-game-manager.sh -i`
|
||||||
|
- launcher flow: `./linux-game-manager.sh`
|
||||||
|
- removal flow: `./linux-game-manager.sh -r`
|
||||||
|
- update flow: `./linux-game-manager.sh -u`
|
||||||
|
3. Run shellcheck on every edited bash script and fix all issues.
|
||||||
|
- If shellcheck is unavailable, prompt the user to install it before continuing.
|
||||||
|
4. Validate this skill structure after edits:
|
||||||
|
- `python3 /home/storm/.codex/skills/.system/skill-creator/scripts/quick_validate.py .codex/skills/linux-game-manager-dev`
|
||||||
|
|
||||||
|
## Mandatory Skill Maintenance
|
||||||
|
|
||||||
|
Treat this skill as stale immediately after any change to:
|
||||||
|
- `linux-game-manager.sh`
|
||||||
|
- Any file in `.install/`, `.launch/`, `.update/`, or `speech/`
|
||||||
|
- `README.md`
|
||||||
|
- Any change to game lifecycle expectations (install path rules, update hooks, CLI options, helper function contracts)
|
||||||
|
|
||||||
|
When stale, perform the full refresh workflow in `references/skill-maintenance.md` before completing the task.
|
||||||
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
- `references/core-map.md`: Architecture and extension map.
|
||||||
|
- `references/game-extension.md`: Exact workflow for adding/removing/extending games.
|
||||||
|
- `references/skill-maintenance.md`: Critical instructions to keep this skill accurate after code changes.
|
||||||
|
- `references/tooling-prereqs.md`: Required tools and shellcheck installation prompts by distro.
|
||||||
|
|
||||||
|
## Scripts
|
||||||
|
|
||||||
|
- `scripts/audit_game_catalog.py`: Reports installer/launcher/update consistency and disabled entries.
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
interface:
|
||||||
|
display_name: "Linux Game Manager Dev"
|
||||||
|
short_description: "Add games and extend linux-game-manager safely"
|
||||||
|
default_prompt: "Use the project workflows to add games, modify manager behavior, validate accessibility-friendly flows, and keep this skill synchronized with code changes."
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
# Linux Game Manager Core Map
|
||||||
|
|
||||||
|
Last refreshed: 2026-11-05
|
||||||
|
|
||||||
|
## Top-Level Structure
|
||||||
|
|
||||||
|
- `linux-game-manager.sh`: Main orchestrator, UI wrappers, CLI option handling, install/remove/update flows, cache and settings behavior.
|
||||||
|
- `.install/`: Per-game installer scripts sourced by `game_installer`.
|
||||||
|
- `.launch/`: Per-game launch scripts (`.game`) and runnable entries (`.sh`, usually symlinks).
|
||||||
|
- `.update/`: Optional per-game update scripts expected to define `run_update()`.
|
||||||
|
- `.includes/ipfs.sh`: Central associative array of IPFS download URLs, expanded against the configured gateway at startup.
|
||||||
|
- `.includes/desktop.sh`: Game-specific desktop shortcuts with Desktop Entry and Exec argument escaping.
|
||||||
|
- `.includes/wickets.sh`: Shared Wickets installer/updater; resolves the latest GitHub release and preserves portable saves.
|
||||||
|
- `speech/speak_window_title.sh`: Accessibility helper for announcing focused window titles.
|
||||||
|
- `README.md`: Project summary and high-level behavior notes.
|
||||||
|
- `.files/`: Game-specific auxiliary assets/scripts used by some installers or launchers.
|
||||||
|
|
||||||
|
## Catalog Snapshot
|
||||||
|
|
||||||
|
- Installers: 50 (`.install/*.sh`)
|
||||||
|
- Launcher definitions: 50 (`.launch/*.game`)
|
||||||
|
- Launcher runnable entries: 38 (`.launch/*.sh`, both symlinks and files; varies with local installations)
|
||||||
|
- Update scripts: 11 (`.update/*.sh`)
|
||||||
|
|
||||||
|
Regenerate this snapshot with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Main Runtime Flows
|
||||||
|
|
||||||
|
1. **Install flow**
|
||||||
|
- `game_installer` builds menu from `.install/*.sh`.
|
||||||
|
- Selected installer is sourced in the current shell.
|
||||||
|
- Monkey Spank clones its required submodules recursively and stops installation if cloning fails.
|
||||||
|
- Shared downloads try `curl` first, fall back to `wget` when available, validate archive payloads before install, and reject obvious HTML error pages for unknown file types.
|
||||||
|
- `download_named()` shares the same cache validation path as `download()`, so resolved asset URLs must still produce a valid payload for their file extension.
|
||||||
|
- RS Games installs the fixed 2.3 x86_64 archive under `${installPath}/RS_Games` and launches `./rsg` from that directory. The archive omits `speechd`; the installer requires host Python Speech Dispatcher bindings and copies their Python sources into `_internal/speechd`. Run `.files/rs-games-alsa.py` to silently test default-device initialization with the bundled library. Keep a working bundle untouched. Only set it aside as `libasound.so.2.bundled` when bundled initialization fails and system ALSA passes the same check; restore it if the system check fails. Inconclusive initial probes retain the bundle and report diagnostics. The bundled library has incompatible plugin paths and symbol versions on Arch Linux. Run `python3 -B -m unittest discover -s tests` for ALSA selection/restoration and path-resolution regressions. Run `.files/rs-games-audio.py` after extraction to correct non-Windows file-path encoding in `sound_lib.stream`; the helper renames its frozen PYZ entry so the corrected filesystem source is used and preserves `rsg.lgm-original`. Confirm with the frozen importer, since direct BASS decoding bypasses the failing wrapper. The repair also installs `sound_lib/lgm_paths.py` for per-call case-insensitive sound lookup: exact paths win, otherwise each component must have one case-insensitive match; missing or ambiguous paths stay unchanged. Downloads are never renamed and misses are not cached. Validate with `python3 -B -m unittest discover -s tests -p "test_rs_games_paths.py"` and the actual frozen importer. Client logs are in `~/.ZGP/errors.log`.
|
||||||
|
- Wickets resolves the latest stable GitHub release on each install/update, extracts its Linux x64 tarball into staging, and overlays `${installPath}/Wickets` while preserving `saves`. A `.lgm-version` marker records the release installed by the manager.
|
||||||
|
- If `.launch/<game>.game` exists and `.launch/<game>.sh` does not, the manager creates a symlink using the repository root, even if the installer changed directories.
|
||||||
|
|
||||||
|
2. **Launch flow**
|
||||||
|
- `game_launcher` enumerates `.launch/*.sh` entries.
|
||||||
|
- Entries with first line `#//` are skipped.
|
||||||
|
- Selected launcher is sourced/executed.
|
||||||
|
- The launch menu offers Desktop Shortcut in both Yad and dialog. It writes an executable `~/Desktop/linux-game-manager-<Game Name>.desktop`, refuses to overwrite existing files, and returns to the menu. The shortcut runs the manager with `-l` and sets its working directory to the repository root.
|
||||||
|
- `game_launcher <Game Name>` skips the menu and selects an installed, enabled entry by its exact display name. Missing or disabled entries fail with a message. Launcher discovery uses `scriptRoot` even when called from another working directory.
|
||||||
|
- `ui_menu --desktop-shortcut` adds the launch-menu buttons and returns status 3 for shortcut creation. Ordinary `ui_menu` calls keep their standard buttons. Both modes preserve cancellation status and discard any cancelled selection.
|
||||||
|
- Run `bash tests/game_shortcut_tests.sh` for isolated menu, direct-launch, CLI, and Desktop Entry checks; these require Python with PyGObject and `desktop-file-validate`. They do not launch installed games or use real user state. Live keyboard, screen-reader, and real-game acceptance remains separate.
|
||||||
|
- Monkey Spank runs from its repository directory so relative sound and text assets resolve; its explicit directory assignment also identifies the removal root.
|
||||||
|
- Text-terminal launchers can fall back to `xterm`, which inherits the requested working directory before executing the game command.
|
||||||
|
|
||||||
|
3. **Removal flow**
|
||||||
|
- `game_removal` resolves launcher entry to real script.
|
||||||
|
- It scans launcher script lines for a non-comment `${installPath}/...` path assignment and uses that to infer the directory to remove.
|
||||||
|
- If no `installPath` reference is found, only launcher entry is removed.
|
||||||
|
|
||||||
|
4. **Update flow**
|
||||||
|
- `game_update` lists `.update/*.sh`.
|
||||||
|
- Selected updater is sourced.
|
||||||
|
- `run_update()` is called and must exist.
|
||||||
|
- Wickets requires an existing installation, refreshes release metadata even with cached archives, and exits after an up-to-date notice if `.lgm-version` matches. Its own in-game updater is also available from 1.2.0 onward.
|
||||||
|
|
||||||
|
## CLI Surface
|
||||||
|
|
||||||
|
- `-i`: install game
|
||||||
|
- `-l <Game Name>`: launch an installed, enabled game directly by exact menu name
|
||||||
|
- `-r`: remove game
|
||||||
|
- `-u`: update game
|
||||||
|
- `-t`: show number of available games
|
||||||
|
- `-C`: clear cache
|
||||||
|
- `-D`: create desktop launcher; terminal discovery includes `xterm`, using its `-T` title option instead of `-t`
|
||||||
|
- `-L`: show license
|
||||||
|
- `-h`: show help
|
||||||
|
- `-N`: enable no-cache mode
|
||||||
|
- `-R`: force redownload mode
|
||||||
|
|
||||||
|
## Config and State
|
||||||
|
|
||||||
|
- Cache: `${XDG_CACHE_HOME:-$HOME/.cache}/linux-game-manager`
|
||||||
|
- Config base: `${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/linux-game-manager`
|
||||||
|
- Settings overrides: `settings.conf` in config base
|
||||||
|
- Default install root: `${HOME}/.local/games`
|
||||||
|
- IPFS gateway: `${ipfsGateway:-https://ipfs.stormux.org}`; `.includes/ipfs.sh` is sourced after settings so centralized URLs honor the override.
|
||||||
|
|
||||||
|
## Contributor Pitfalls
|
||||||
|
|
||||||
|
- Mismatched `.install/<Game>.sh` vs `.launch/<Game>.game` names create orphaned or invisible entries.
|
||||||
|
- Missing `installPath` reference in launcher prevents full uninstall.
|
||||||
|
- `game_removal` expects a concrete `${installPath}/...` path in the launcher; indirect path construction can prevent removal from finding the install directory.
|
||||||
|
- Missing `run_update()` in `.update` scripts breaks update flow.
|
||||||
|
- Bypassing shared download helpers risks cache and validation regressions.
|
||||||
|
- Installers may change the working directory; repository-relative manager paths must therefore use the resolved script root rather than `${0%/*}`.
|
||||||
|
- Use `alert` with its message arguments instead of chaining `alert` and `ui_msgbox`, otherwise `yad` users can get an extra acknowledgement dialog that does not include the actual guidance.
|
||||||
|
- For `uv`-based Python games that need `speechd`, copy host Python `speechd` bindings into a game-local directory and export `PYTHONPATH` from the launcher.
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
# Game Extension Workflow
|
||||||
|
|
||||||
|
Use this workflow whenever adding, renaming, removing, or substantially changing a game.
|
||||||
|
|
||||||
|
## Add a New Game
|
||||||
|
|
||||||
|
1. Create installer script:
|
||||||
|
- Path: `.install/<Game Name>.sh`
|
||||||
|
- Keep first line active (do not start with `#//`).
|
||||||
|
- Reuse manager helpers (`check_architecture`, `check_dependencies`, `download`, `download_named`, `get_installer`, `ui_*`).
|
||||||
|
- Install into a deterministic path under `${installPath}`.
|
||||||
|
|
||||||
|
2. Create launcher definition:
|
||||||
|
- Path: `.launch/<Game Name>.game`
|
||||||
|
- Keep base filename identical to installer (`<Game Name>`).
|
||||||
|
- Include an explicit install-path variable based on `installPath`, for example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gamePath="${installPath}/MyGame"
|
||||||
|
```
|
||||||
|
|
||||||
|
- Run the game from that path.
|
||||||
|
|
||||||
|
3. Optional update script:
|
||||||
|
- Path: `.update/<Game Name>.sh`
|
||||||
|
- Implement `run_update()` (required by update flow).
|
||||||
|
|
||||||
|
4. Let installer create runnable launcher entry:
|
||||||
|
- The manager auto-creates `.launch/<Game Name>.sh` symlink when installer completes and `.game` exists.
|
||||||
|
|
||||||
|
## Rename a Game Safely
|
||||||
|
|
||||||
|
1. Rename `.install/<Old>.sh` to `.install/<New>.sh`.
|
||||||
|
2. Rename `.launch/<Old>.game` to `.launch/<New>.game`.
|
||||||
|
3. Rename `.update/<Old>.sh` if present.
|
||||||
|
4. Remove stale `.launch/<Old>.sh` if still present.
|
||||||
|
5. Re-run catalog audit and manual checks.
|
||||||
|
|
||||||
|
## Remove a Game From Repo
|
||||||
|
|
||||||
|
1. Delete `.install/<Game>.sh`.
|
||||||
|
2. Delete `.launch/<Game>.game`.
|
||||||
|
3. Delete `.launch/<Game>.sh` if tracked.
|
||||||
|
4. Delete `.update/<Game>.sh` if present.
|
||||||
|
5. Run catalog audit to confirm no orphan entries remain.
|
||||||
|
|
||||||
|
## Disable Policy (Important)
|
||||||
|
|
||||||
|
When a request says "disable <game>" without more detail:
|
||||||
|
|
||||||
|
1. Default behavior: disable installs only.
|
||||||
|
- Add `#//` to first line of `.install/<Game Name>.sh`.
|
||||||
|
- Do not disable `.launch/<Game Name>.game` by default.
|
||||||
|
- This preserves playability for users who already have the game installed.
|
||||||
|
|
||||||
|
2. If user explicitly requests complete disable:
|
||||||
|
- Add `#//` to first line of both:
|
||||||
|
- `.install/<Game Name>.sh`
|
||||||
|
- `.launch/<Game Name>.game`
|
||||||
|
|
||||||
|
3. If wording is ambiguous but could imply full disable/removal:
|
||||||
|
- Ask a short clarification question before changing launcher/removal behavior.
|
||||||
|
|
||||||
|
## Manual Validation Checklist
|
||||||
|
|
||||||
|
1. Run installer flow:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./linux-game-manager.sh -i
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Confirm launcher files exist:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ls ".launch/<Game Name>.game" ".launch/<Game Name>.sh"
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Run launcher flow:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./linux-game-manager.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Run removal flow:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./linux-game-manager.sh -r
|
||||||
|
```
|
||||||
|
|
||||||
|
5. If updater exists, run update flow:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./linux-game-manager.sh -u
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Run consistency audit:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Script Authoring Rules
|
||||||
|
|
||||||
|
- Use camelCase variable names.
|
||||||
|
- Use snake_case for function names.
|
||||||
|
- Keep scripts robust when sourced in the manager shell.
|
||||||
|
- Clone games with required submodules using `git clone --recurse-submodules` and stop installation on clone failure.
|
||||||
|
- Launch games that load relative assets from their own directory. Monkey Spank uses `${installPath}/monkeyspank` as its working directory and removal root.
|
||||||
|
- Wickets shares install/update logic in `.includes/wickets.sh`; its versioned tarball has one top-level directory, and portable saves must survive updates. Always refresh GitHub release metadata rather than reusing a cached latest-release response.
|
||||||
|
- RS Games 2.3 has a single `rsg/` archive root; strip that component into `${installPath}/RS_Games` and launch `./rsg` from that directory. Require `python-speechd:speechd` and copy its Python sources into `_internal/speechd`, since the frozen runtime cannot import host site-packages and the release omits these bindings. Run `.files/rs-games-alsa.py` to silently test default-device initialization with the bundled library. Keep a working bundle untouched. Only set it aside as `libasound.so.2.bundled` when bundled initialization fails and system ALSA passes the same check; restore it if the system check fails. Inconclusive initial probes retain the bundle and report diagnostics. The bundled library has incompatible plugin paths and symbol versions on Arch Linux. Run `python3 -B -m unittest discover -s tests` for ALSA selection/restoration and path-resolution regressions. Run `.files/rs-games-audio.py` after extraction to correct non-Windows file-path encoding in `sound_lib.stream`; the helper renames its frozen PYZ entry so the corrected filesystem source is used and preserves `rsg.lgm-original`. Confirm with the frozen importer, since direct BASS decoding bypasses the failing wrapper. The repair also installs `sound_lib/lgm_paths.py` for per-call case-insensitive sound lookup: exact paths win, otherwise each component must have one case-insensitive match; missing or ambiguous paths stay unchanged. Downloads are never renamed and misses are not cached. Validate with `python3 -B -m unittest discover -s tests -p "test_rs_games_paths.py"` and the actual frozen importer. Client logs are in `~/.ZGP/errors.log`.
|
||||||
|
- Avoid introducing unnecessary colorized output.
|
||||||
|
- For edited bash scripts, run shellcheck and fix all errors.
|
||||||
|
- If `shellcheck` is not installed, prompt the user to install it first (see `references/tooling-prereqs.md`).
|
||||||
|
|
||||||
|
## Pattern: uv + Host Python speechd Bindings
|
||||||
|
|
||||||
|
Use this pattern for Python games installed with `uv` when runtime speech support depends on `import speechd`.
|
||||||
|
|
||||||
|
1. In installer script:
|
||||||
|
- Check dependencies: `git`, `uv`, and host python binding import (`python-speechd:speechd`).
|
||||||
|
- Clone game repository into `${installPath}/<GameRepoDir>`.
|
||||||
|
- Run `uv sync` in the project directory that contains `pyproject.toml`.
|
||||||
|
- Resolve speechd source path from host Python via:
|
||||||
|
- `python3 -c 'import pathlib,speechd; print(pathlib.Path(speechd.__file__).resolve())'`
|
||||||
|
- Copy the module/package into a game-local directory such as:
|
||||||
|
- `${installPath}/<GameRepoDir>/<RuntimePath>/.host-python/`
|
||||||
|
- Fail with a clear message if import or copy fails.
|
||||||
|
|
||||||
|
2. In launcher script:
|
||||||
|
- Export `PYTHONPATH` with the game-local `.host-python` directory prepended.
|
||||||
|
- Launch via `uv run ...` from the same directory used for `uv sync`.
|
||||||
|
|
||||||
|
3. Removal safety:
|
||||||
|
- Ensure the launcher contains a concrete `${installPath}/...` path assignment so `game_removal` can infer the game root correctly.
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# Skill Maintenance (Critical)
|
||||||
|
|
||||||
|
This skill is only trustworthy if it is refreshed immediately after behavior changes.
|
||||||
|
|
||||||
|
## Mandatory Refresh Triggers
|
||||||
|
|
||||||
|
Run this maintenance workflow whenever any of these change:
|
||||||
|
|
||||||
|
- `linux-game-manager.sh`
|
||||||
|
- Anything in `.install/`
|
||||||
|
- Anything in `.launch/`
|
||||||
|
- Anything in `.update/`
|
||||||
|
- Anything in `speech/`
|
||||||
|
- `README.md`
|
||||||
|
- Any game lifecycle contract (install path usage, symlink behavior, update function contracts, CLI flags)
|
||||||
|
|
||||||
|
## Refresh Workflow
|
||||||
|
|
||||||
|
1. Run catalog audit and capture output:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Re-check core flow definitions in `linux-game-manager.sh`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rg -n "game_installer|game_launcher|game_removal|game_update|getopts|help\\(" linux-game-manager.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Update skill references:
|
||||||
|
- Update `references/core-map.md` catalog snapshot if counts changed.
|
||||||
|
- Update `references/core-map.md` flow descriptions if behavior changed.
|
||||||
|
- Update `references/game-extension.md` if onboarding or naming rules changed.
|
||||||
|
- Update this file if refresh triggers or process changed.
|
||||||
|
|
||||||
|
4. Validate the skill structure:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 /home/storm/.codex/skills/.system/skill-creator/scripts/quick_validate.py .codex/skills/linux-game-manager-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
5. If any bash scripts changed, run shellcheck on edited files and fix all errors.
|
||||||
|
- If `shellcheck` is missing, pause and prompt the user to install it using `references/tooling-prereqs.md`.
|
||||||
|
|
||||||
|
## Completion Criteria
|
||||||
|
|
||||||
|
Do not consider maintenance complete until all are true:
|
||||||
|
|
||||||
|
1. Catalog audit shows no critical mismatches, and any warnings are reviewed.
|
||||||
|
2. All changed behavior is reflected in skill reference files.
|
||||||
|
3. Skill passes `quick_validate.py`.
|
||||||
|
4. Any edited bash scripts are shellcheck-clean.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Tooling Prerequisites
|
||||||
|
|
||||||
|
## Required Tool for Bash Changes
|
||||||
|
|
||||||
|
- `shellcheck` is mandatory whenever editing any bash/sh file in this repository.
|
||||||
|
- If `shellcheck` is not available, prompt the user to install it before continuing validation.
|
||||||
|
|
||||||
|
Check availability:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
command -v shellcheck
|
||||||
|
```
|
||||||
|
|
||||||
|
## Prompt Template
|
||||||
|
|
||||||
|
Use this exact style when missing:
|
||||||
|
|
||||||
|
`shellcheck is required for bash/sh edits in linux-game-manager. Please install it, then I will continue validation.`
|
||||||
|
|
||||||
|
## Install Commands by Common Distro Family
|
||||||
|
|
||||||
|
- Arch/Manjaro:
|
||||||
|
- `sudo pacman -S shellcheck`
|
||||||
|
- Debian/Ubuntu/Linux Mint/Pop!_OS:
|
||||||
|
- `sudo apt update && sudo apt install -y shellcheck`
|
||||||
|
- Fedora/RHEL/CentOS Stream:
|
||||||
|
- `sudo dnf install -y ShellCheck`
|
||||||
|
- openSUSE:
|
||||||
|
- `sudo zypper install -y ShellCheck`
|
||||||
|
- Alpine:
|
||||||
|
- `sudo apk add shellcheck`
|
||||||
|
|
||||||
|
If distro is unknown, ask the user what distribution they are on and provide the matching package command.
|
||||||
|
|
||||||
|
## Notes for LGM Collaboration
|
||||||
|
|
||||||
|
- Do not skip shellcheck for “small” bash changes.
|
||||||
|
- Fix all shellcheck errors; warnings may be suppressed only when required by sourced-global patterns and with a short comment.
|
||||||
@@ -0,0 +1,202 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Audit Linux Game Manager catalog consistency."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def read_first_line(file_path: Path) -> str:
|
||||||
|
try:
|
||||||
|
with file_path.open("r", encoding="utf-8") as handle:
|
||||||
|
return handle.readline().strip()
|
||||||
|
except OSError:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
def has_run_update(file_path: Path) -> bool:
|
||||||
|
try:
|
||||||
|
content = file_path.read_text(encoding="utf-8")
|
||||||
|
except OSError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
return "run_update()" in content or "run_update ()" in content
|
||||||
|
|
||||||
|
|
||||||
|
def collect_names(file_paths: list[Path], suffix: str) -> list[str]:
|
||||||
|
return sorted(file_path.name[: -len(suffix)] for file_path in file_paths)
|
||||||
|
|
||||||
|
|
||||||
|
def count_disabled(file_paths: list[Path]) -> list[str]:
|
||||||
|
disabledNames = []
|
||||||
|
for file_path in file_paths:
|
||||||
|
if read_first_line(file_path).startswith("#//"):
|
||||||
|
disabledNames.append(file_path.name)
|
||||||
|
return sorted(disabledNames)
|
||||||
|
|
||||||
|
|
||||||
|
def build_report(repo_root: Path) -> dict:
|
||||||
|
installDir = repo_root / ".install"
|
||||||
|
launchDir = repo_root / ".launch"
|
||||||
|
updateDir = repo_root / ".update"
|
||||||
|
|
||||||
|
missingDirs = [
|
||||||
|
str(path.relative_to(repo_root))
|
||||||
|
for path in [installDir, launchDir, updateDir]
|
||||||
|
if not path.exists()
|
||||||
|
]
|
||||||
|
if missingDirs:
|
||||||
|
raise FileNotFoundError(
|
||||||
|
f"Expected directories not found: {', '.join(missingDirs)}"
|
||||||
|
)
|
||||||
|
|
||||||
|
installPaths = sorted(installDir.glob("*.sh"))
|
||||||
|
launchGamePaths = sorted(launchDir.glob("*.game"))
|
||||||
|
launchShPaths = sorted(launchDir.glob("*.sh"))
|
||||||
|
updatePaths = sorted(updateDir.glob("*.sh"))
|
||||||
|
|
||||||
|
installerNames = collect_names(installPaths, ".sh")
|
||||||
|
launcherGameNames = collect_names(launchGamePaths, ".game")
|
||||||
|
launcherShNames = collect_names(launchShPaths, ".sh")
|
||||||
|
|
||||||
|
launcherSymlinkCount = sum(1 for path in launchShPaths if path.is_symlink())
|
||||||
|
launcherFileCount = len(launchShPaths) - launcherSymlinkCount
|
||||||
|
|
||||||
|
missingLauncherGameForInstaller = sorted(
|
||||||
|
set(installerNames) - set(launcherGameNames)
|
||||||
|
)
|
||||||
|
missingInstallerForLauncherGame = sorted(
|
||||||
|
set(launcherGameNames) - set(installerNames)
|
||||||
|
)
|
||||||
|
missingLauncherShForLauncherGame = sorted(
|
||||||
|
set(launcherGameNames) - set(launcherShNames)
|
||||||
|
)
|
||||||
|
orphanLauncherSh = sorted(set(launcherShNames) - set(launcherGameNames))
|
||||||
|
|
||||||
|
updateWithoutRunFunction = sorted(
|
||||||
|
path.name for path in updatePaths if not has_run_update(path)
|
||||||
|
)
|
||||||
|
|
||||||
|
report = {
|
||||||
|
"repoRoot": str(repo_root),
|
||||||
|
"criticalMismatches": [
|
||||||
|
"missingLauncherGameForInstaller",
|
||||||
|
"updateScriptsMissingRunUpdate",
|
||||||
|
],
|
||||||
|
"warningMismatches": [
|
||||||
|
"missingInstallerForLauncherGame",
|
||||||
|
"missingLauncherShForLauncherGame",
|
||||||
|
"orphanLauncherSh",
|
||||||
|
],
|
||||||
|
"counts": {
|
||||||
|
"installers": len(installPaths),
|
||||||
|
"launcherGameDefinitions": len(launchGamePaths),
|
||||||
|
"launcherRunnableEntries": len(launchShPaths),
|
||||||
|
"launcherRunnableSymlinks": launcherSymlinkCount,
|
||||||
|
"launcherRunnableRegularFiles": launcherFileCount,
|
||||||
|
"updateScripts": len(updatePaths),
|
||||||
|
},
|
||||||
|
"disabledEntries": {
|
||||||
|
"installers": count_disabled(installPaths),
|
||||||
|
"launchers": count_disabled(launchShPaths),
|
||||||
|
},
|
||||||
|
"mismatches": {
|
||||||
|
"missingLauncherGameForInstaller": missingLauncherGameForInstaller,
|
||||||
|
"missingInstallerForLauncherGame": missingInstallerForLauncherGame,
|
||||||
|
"missingLauncherShForLauncherGame": missingLauncherShForLauncherGame,
|
||||||
|
"orphanLauncherSh": orphanLauncherSh,
|
||||||
|
"updateScriptsMissingRunUpdate": updateWithoutRunFunction,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return report
|
||||||
|
|
||||||
|
|
||||||
|
def print_human_report(report: dict) -> None:
|
||||||
|
counts = report["counts"]
|
||||||
|
mismatches = report["mismatches"]
|
||||||
|
criticalMismatches = report["criticalMismatches"]
|
||||||
|
warningMismatches = report["warningMismatches"]
|
||||||
|
disabledEntries = report["disabledEntries"]
|
||||||
|
|
||||||
|
print(f"Repository: {report['repoRoot']}")
|
||||||
|
print("Counts:")
|
||||||
|
print(f" Installers: {counts['installers']}")
|
||||||
|
print(f" Launcher .game files: {counts['launcherGameDefinitions']}")
|
||||||
|
print(f" Launcher .sh entries: {counts['launcherRunnableEntries']}")
|
||||||
|
print(f" Symlinks: {counts['launcherRunnableSymlinks']}")
|
||||||
|
print(f" Regular files: {counts['launcherRunnableRegularFiles']}")
|
||||||
|
print(f" Update scripts: {counts['updateScripts']}")
|
||||||
|
|
||||||
|
print("Disabled entries:")
|
||||||
|
print(f" Installers: {len(disabledEntries['installers'])}")
|
||||||
|
if disabledEntries["installers"]:
|
||||||
|
print(" " + ", ".join(disabledEntries["installers"]))
|
||||||
|
print(f" Launchers: {len(disabledEntries['launchers'])}")
|
||||||
|
if disabledEntries["launchers"]:
|
||||||
|
print(" " + ", ".join(disabledEntries["launchers"]))
|
||||||
|
|
||||||
|
print("Critical checks:")
|
||||||
|
for key in criticalMismatches:
|
||||||
|
values = mismatches[key]
|
||||||
|
print(f" {key}: {len(values)}")
|
||||||
|
if values:
|
||||||
|
print(" " + ", ".join(values))
|
||||||
|
|
||||||
|
print("Warnings:")
|
||||||
|
for key in warningMismatches:
|
||||||
|
values = mismatches[key]
|
||||||
|
print(f" {key}: {len(values)}")
|
||||||
|
if values:
|
||||||
|
print(" " + ", ".join(values))
|
||||||
|
|
||||||
|
criticalTotal = sum(len(mismatches[key]) for key in criticalMismatches)
|
||||||
|
if criticalTotal == 0:
|
||||||
|
print("Result: OK (no critical mismatches)")
|
||||||
|
else:
|
||||||
|
print("Result: ATTENTION REQUIRED (critical mismatches detected)")
|
||||||
|
|
||||||
|
|
||||||
|
def parse_args() -> argparse.Namespace:
|
||||||
|
defaultRepoRoot = Path(__file__).resolve().parents[4]
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description="Audit installer/launcher/update consistency for linux-game-manager."
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--repo-root",
|
||||||
|
default=str(defaultRepoRoot),
|
||||||
|
help=f"Repository root path (default: {defaultRepoRoot})",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--json",
|
||||||
|
action="store_true",
|
||||||
|
help="Emit JSON instead of human-readable text",
|
||||||
|
)
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> int:
|
||||||
|
args = parse_args()
|
||||||
|
repoRoot = Path(args.repo_root).resolve()
|
||||||
|
|
||||||
|
try:
|
||||||
|
report = build_report(repoRoot)
|
||||||
|
except FileNotFoundError as error:
|
||||||
|
print(str(error), file=sys.stderr)
|
||||||
|
return 2
|
||||||
|
|
||||||
|
if args.json:
|
||||||
|
print(json.dumps(report, indent=2, sort_keys=True))
|
||||||
|
else:
|
||||||
|
print_human_report(report)
|
||||||
|
|
||||||
|
criticalTotal = sum(
|
||||||
|
len(report["mismatches"][bucket]) for bucket in report["criticalMismatches"]
|
||||||
|
)
|
||||||
|
return 1 if criticalTotal else 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
raise SystemExit(main())
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Keep bundled ALSA unless the system copy demonstrably fixes audio startup."""
|
||||||
|
|
||||||
|
import ctypes
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def probe_audio(gamePath):
|
||||||
|
probeEnvironment = os.environ.copy()
|
||||||
|
libraryPath = str(gamePath / "_internal")
|
||||||
|
if probeEnvironment.get("LD_LIBRARY_PATH"):
|
||||||
|
libraryPath += os.pathsep + probeEnvironment["LD_LIBRARY_PATH"]
|
||||||
|
probeEnvironment["LD_LIBRARY_PATH"] = libraryPath
|
||||||
|
try:
|
||||||
|
result = subprocess.run(
|
||||||
|
[sys.executable, str(Path(__file__).resolve()), "--probe", str(gamePath)],
|
||||||
|
env=probeEnvironment, capture_output=True, text=True, timeout=10, check=False,
|
||||||
|
)
|
||||||
|
except (OSError, subprocess.TimeoutExpired) as error:
|
||||||
|
return 2, str(error)
|
||||||
|
return result.returncode, (result.stdout + result.stderr).strip()
|
||||||
|
|
||||||
|
|
||||||
|
def configure_alsa(gamePath):
|
||||||
|
libraryPath = gamePath / "_internal/libasound.so.2"
|
||||||
|
if not libraryPath.exists():
|
||||||
|
print("RS Games has no active bundled ALSA library; leaving it unchanged.")
|
||||||
|
return
|
||||||
|
probeStatus, probeDetails = probe_audio(gamePath)
|
||||||
|
if probeStatus == 0:
|
||||||
|
print("RS Games bundled ALSA initializes successfully; keeping it.")
|
||||||
|
return
|
||||||
|
if probeStatus != 1:
|
||||||
|
print(f"Could not verify RS Games audio; keeping bundled ALSA.\n{probeDetails}")
|
||||||
|
return
|
||||||
|
|
||||||
|
backupPath = libraryPath.with_name("libasound.so.2.bundled")
|
||||||
|
if backupPath.exists() and backupPath.read_bytes() != libraryPath.read_bytes():
|
||||||
|
raise ValueError("Existing ALSA backup differs; refusing to overwrite")
|
||||||
|
libraryPath.replace(backupPath)
|
||||||
|
systemWorks = False
|
||||||
|
try:
|
||||||
|
systemStatus, systemDetails = probe_audio(gamePath)
|
||||||
|
systemWorks = systemStatus == 0
|
||||||
|
finally:
|
||||||
|
if not systemWorks:
|
||||||
|
shutil.copy2(backupPath, libraryPath)
|
||||||
|
if systemWorks:
|
||||||
|
print("RS Games bundled ALSA failed; verified system ALSA and preserved the bundled copy.")
|
||||||
|
else:
|
||||||
|
print("Neither ALSA setup could be verified; restored bundled ALSA.")
|
||||||
|
print(f"Bundled: {probeDetails}\nSystem: {systemDetails}")
|
||||||
|
|
||||||
|
|
||||||
|
def run_probe(gamePath):
|
||||||
|
try:
|
||||||
|
bassLibrary = ctypes.CDLL(str(gamePath / "_internal/sound_lib/lib/x64/libbass.so"))
|
||||||
|
bassLibrary.BASS_Init.argtypes = [
|
||||||
|
ctypes.c_int, ctypes.c_uint, ctypes.c_uint, ctypes.c_void_p, ctypes.c_void_p,
|
||||||
|
]
|
||||||
|
if not bassLibrary.BASS_Init(1, 44100, 0, None, None):
|
||||||
|
errorCode = bassLibrary.BASS_ErrorGetCode()
|
||||||
|
print(f"Default audio device initialization failed (BASS error {errorCode}).")
|
||||||
|
return 1 if errorCode == 3 else 2
|
||||||
|
bassLibrary.BASS_Free()
|
||||||
|
return 0
|
||||||
|
except OSError as error:
|
||||||
|
print(f"Audio library could not load: {error}")
|
||||||
|
return 2
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) == 3 and sys.argv[1] == "--probe":
|
||||||
|
raise SystemExit(run_probe(Path(sys.argv[2]).resolve()))
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
raise SystemExit("Usage: rs-games-alsa.py GAME_DIRECTORY")
|
||||||
|
try:
|
||||||
|
configure_alsa(Path(sys.argv[1]).resolve())
|
||||||
|
except (OSError, ValueError) as error:
|
||||||
|
raise SystemExit(f"RS Games ALSA setup failed: {error}") from error
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Repair Linux file paths in the frozen RS Games 2.3 sound wrapper."""
|
||||||
|
|
||||||
|
import marshal
|
||||||
|
from pathlib import Path
|
||||||
|
import shutil
|
||||||
|
import struct
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def repair_audio(gamePath):
|
||||||
|
executablePath = gamePath / "rsg"
|
||||||
|
streamPath = gamePath / "_internal/sound_lib/stream.py"
|
||||||
|
executableData = executablePath.read_bytes()
|
||||||
|
streamData = streamPath.read_bytes()
|
||||||
|
originalBlock = (
|
||||||
|
b'if platform.system() == "Darwin" and file and not mem:\r\n'
|
||||||
|
b' unicode = False\r\n'
|
||||||
|
b' file = file.encode(sys.getfilesystemencoding())'
|
||||||
|
)
|
||||||
|
encodedBlock = (
|
||||||
|
b'if platform.system() != "Windows" and not mem and isinstance(file, (str, bytes, os.PathLike)):\r\n'
|
||||||
|
b' unicode = False\r\n'
|
||||||
|
b' file = os.fsencode(file)'
|
||||||
|
)
|
||||||
|
repairedBlock = (
|
||||||
|
b'if platform.system() != "Windows" and not mem and isinstance(file, (str, bytes, os.PathLike)):\r\n'
|
||||||
|
b' from .lgm_paths import resolve_sound_path\r\n'
|
||||||
|
b' unicode = False\r\n'
|
||||||
|
b' file = os.fsencode(resolve_sound_path(file))'
|
||||||
|
)
|
||||||
|
resolverData = Path(__file__).with_name("rs-games-paths.py").read_bytes()
|
||||||
|
if streamData.count(originalBlock) == 1:
|
||||||
|
repairedStream = streamData.replace(originalBlock, repairedBlock)
|
||||||
|
elif streamData.count(encodedBlock) == 1:
|
||||||
|
repairedStream = streamData.replace(encodedBlock, repairedBlock)
|
||||||
|
elif streamData.count(repairedBlock) == 1:
|
||||||
|
repairedStream = streamData
|
||||||
|
else:
|
||||||
|
raise ValueError("Unexpected RS Games sound wrapper; refusing to patch")
|
||||||
|
|
||||||
|
# Rename only this module's PYZ entry. PyInstaller then falls back to the
|
||||||
|
# supplied filesystem source, making the corrected stream.py effective.
|
||||||
|
cookiePosition = executableData.rfind(b"MEI\014\013\012\013\016")
|
||||||
|
if cookiePosition < 0:
|
||||||
|
raise ValueError("PyInstaller archive cookie not found")
|
||||||
|
_, packageSize, tocOffset, tocSize, pythonVersion, _ = struct.unpack_from(
|
||||||
|
"!8sIIII64s", executableData, cookiePosition
|
||||||
|
)
|
||||||
|
if pythonVersion != 312:
|
||||||
|
raise ValueError("Expected the Python 3.12 RS Games release")
|
||||||
|
packageStart = cookiePosition + 88 - packageSize
|
||||||
|
entryPosition = packageStart + tocOffset
|
||||||
|
tocEnd = entryPosition + tocSize
|
||||||
|
pyzStart = None
|
||||||
|
pyzEnd = None
|
||||||
|
while entryPosition < tocEnd:
|
||||||
|
entrySize, offset, dataSize, _, compressed, entryType = struct.unpack_from(
|
||||||
|
"!IIIIBc", executableData, entryPosition
|
||||||
|
)
|
||||||
|
if entrySize < 18 or entryPosition + entrySize > tocEnd:
|
||||||
|
raise ValueError("Invalid archive table entry")
|
||||||
|
entryName = executableData[entryPosition + 18:entryPosition + entrySize].rstrip(b"\0")
|
||||||
|
if entryName == b"PYZ.pyz" and entryType == b"z" and not compressed:
|
||||||
|
pyzStart = packageStart + offset
|
||||||
|
pyzEnd = pyzStart + dataSize
|
||||||
|
entryPosition += entrySize
|
||||||
|
if pyzStart is None or executableData[pyzStart:pyzStart + 4] != b"PYZ\0":
|
||||||
|
raise ValueError("Uncompressed PYZ archive not found")
|
||||||
|
pyzTocStart = pyzStart + struct.unpack_from("!i", executableData, pyzStart + 8)[0]
|
||||||
|
if not pyzStart + 12 <= pyzTocStart < pyzEnd <= cookiePosition:
|
||||||
|
raise ValueError("Invalid PYZ table bounds")
|
||||||
|
tableData = executableData[pyzTocStart:pyzEnd]
|
||||||
|
originalName = b"sound_lib.stream"
|
||||||
|
savedName = b"lgm_saved_stream"
|
||||||
|
originalTable = dict(marshal.loads(tableData))
|
||||||
|
if "sound_lib.stream" in originalTable and "lgm_saved_stream" not in originalTable:
|
||||||
|
if tableData.count(originalName) != 1:
|
||||||
|
raise ValueError("Ambiguous sound module table entry")
|
||||||
|
repairedTableData = tableData.replace(originalName, savedName)
|
||||||
|
expectedTable = originalTable.copy()
|
||||||
|
expectedTable["lgm_saved_stream"] = expectedTable.pop("sound_lib.stream")
|
||||||
|
if dict(marshal.loads(repairedTableData)) != expectedTable:
|
||||||
|
raise ValueError("Archive table verification failed")
|
||||||
|
repairedExecutable = executableData[:pyzTocStart] + repairedTableData + executableData[pyzEnd:]
|
||||||
|
elif "lgm_saved_stream" in originalTable and "sound_lib.stream" not in originalTable:
|
||||||
|
repairedExecutable = executableData
|
||||||
|
else:
|
||||||
|
raise ValueError("Unexpected sound module archive entries")
|
||||||
|
|
||||||
|
if repairedExecutable != executableData:
|
||||||
|
backupPath = executablePath.with_name("rsg.lgm-original")
|
||||||
|
if backupPath.exists() and backupPath.read_bytes() != executableData:
|
||||||
|
raise ValueError("Existing executable backup differs; refusing to overwrite")
|
||||||
|
if not backupPath.exists():
|
||||||
|
shutil.copy2(executablePath, backupPath)
|
||||||
|
streamPath.with_name("lgm_paths.py").write_bytes(resolverData)
|
||||||
|
streamPath.write_bytes(repairedStream)
|
||||||
|
if repairedExecutable != executableData:
|
||||||
|
temporaryPath = executablePath.with_name("rsg.lgm-new")
|
||||||
|
temporaryPath.write_bytes(repairedExecutable)
|
||||||
|
temporaryPath.chmod(executablePath.stat().st_mode)
|
||||||
|
temporaryPath.replace(executablePath)
|
||||||
|
print("RS Games Linux audio file paths repaired.")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
raise SystemExit("Usage: rs-games-audio.py GAME_DIRECTORY")
|
||||||
|
try:
|
||||||
|
repair_audio(Path(sys.argv[1]))
|
||||||
|
except (OSError, ValueError, EOFError, TypeError, struct.error) as error:
|
||||||
|
raise SystemExit(f"RS Games audio repair failed: {error}") from error
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
"""Resolve uniquely matching sound paths from Windows-authored game packs."""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def resolve_sound_path(filePath):
|
||||||
|
originalPath = os.fspath(filePath)
|
||||||
|
if os.path.exists(originalPath):
|
||||||
|
return originalPath
|
||||||
|
|
||||||
|
pathText = os.fsdecode(originalPath)
|
||||||
|
resolvedPath = os.path.sep if os.path.isabs(pathText) else os.curdir
|
||||||
|
for component in pathText.split(os.path.sep):
|
||||||
|
if component in ("", "."):
|
||||||
|
continue
|
||||||
|
candidatePath = os.path.join(resolvedPath, component)
|
||||||
|
if os.path.exists(candidatePath):
|
||||||
|
resolvedPath = candidatePath
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
with os.scandir(resolvedPath) as entries:
|
||||||
|
matches = [entry.name for entry in entries if entry.name.casefold() == component.casefold()]
|
||||||
|
except OSError:
|
||||||
|
return originalPath
|
||||||
|
if len(matches) != 1:
|
||||||
|
return originalPath
|
||||||
|
resolvedPath = os.path.join(resolvedPath, matches[0])
|
||||||
|
|
||||||
|
return os.fsencode(resolvedPath) if isinstance(originalPath, bytes) else resolvedPath
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# shellcheck shell=bash
|
||||||
|
|
||||||
|
# Desktop Entry escaping is separate from Exec argument quoting.
|
||||||
|
desktop_entry_value() {
|
||||||
|
local value="$1"
|
||||||
|
value="${value//\\/\\\\}"
|
||||||
|
value="${value//$'\n'/\\n}"
|
||||||
|
value="${value//$'\r'/\\r}"
|
||||||
|
value="${value//$'\t'/\\t}"
|
||||||
|
printf '%s' "$value"
|
||||||
|
}
|
||||||
|
|
||||||
|
desktop_exec_argument() {
|
||||||
|
local value="$1"
|
||||||
|
value="${value//%/%%}"
|
||||||
|
value="${value//\\/\\\\}"
|
||||||
|
value="${value//\"/\\\"}"
|
||||||
|
value="${value//\$/\\\$}"
|
||||||
|
value="${value//\`/\\\`}"
|
||||||
|
desktop_entry_value "\"${value}\""
|
||||||
|
}
|
||||||
|
|
||||||
|
game_desktop_shortcut() {
|
||||||
|
local gameName="$1"
|
||||||
|
local fileName="${gameName//\//_}"
|
||||||
|
fileName="${fileName//[$'\n\r\t']/_}"
|
||||||
|
local desktopFile="${HOME}/Desktop/linux-game-manager-${fileName}.desktop"
|
||||||
|
local launcherPath
|
||||||
|
# shellcheck disable=SC2154 # Set by the manager before sourcing this helper.
|
||||||
|
launcherPath="$(readlink -e "${scriptRoot}/linux-game-manager.sh")" || return 1
|
||||||
|
|
||||||
|
if ! mkdir -p "${HOME}/Desktop"; then
|
||||||
|
ui_msgbox "Desktop Shortcut" "" "Could not create ~/Desktop."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
# Refuse to overwrite files or follow existing symbolic links.
|
||||||
|
if ! (
|
||||||
|
set -o noclobber
|
||||||
|
printf '%s\n' '[Desktop Entry]' \
|
||||||
|
"Name=$(desktop_entry_value "$gameName")" \
|
||||||
|
"Exec=$(desktop_exec_argument "$launcherPath") -l $(desktop_exec_argument "$gameName")" \
|
||||||
|
"Path=$(desktop_entry_value "$scriptRoot")" \
|
||||||
|
'Terminal=true' 'Type=Application' 'Categories=Game;' \
|
||||||
|
> "$desktopFile"
|
||||||
|
); then
|
||||||
|
ui_msgbox "Desktop Shortcut" "" "Could not create ${desktopFile}. Check permissions and whether a shortcut already exists."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! chmod +x "$desktopFile"; then
|
||||||
|
ui_msgbox "Desktop Shortcut" "" "Could not make ${desktopFile} executable."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
ui_msgbox "Desktop Shortcut" "" "Created ${desktopFile}."
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
run_with_optional_gamemode() {
|
||||||
|
if command -v gamemoderun &> /dev/null; then
|
||||||
|
gamemoderun "$@"
|
||||||
|
else
|
||||||
|
"$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2034,SC2154
|
||||||
|
# Central repository for IPFS game download URLs
|
||||||
|
|
||||||
|
declare -Ag ipfs=(
|
||||||
|
# Games (alphabetical order)
|
||||||
|
[Audio_Defence_aarch64]="${ipfsGateway}/ipfs/QmV5ihxcwnjR2hRKyKSgbL24mXzwvsmKKAmWhAw1vw6K6v?filename=AudioDefence-26.09.26-1-aarch64.AppImage"
|
||||||
|
[Audio_Defence_x86_64]="${ipfsGateway}/ipfs/QmSq5a7roo2h2xNgungeLVnmyt7AyjrqzGgrPzRhq7t9Ls?filename=AudioDefence-26.09.26-1-x86_64.AppImage"
|
||||||
|
[FreeDoom]="${ipfsGateway}/ipfs/QmU6REFot8CGVSBy2YWQxnmXoh7M4EF74RxFtLzvtJxoGC?filename=toby_doom_9.0_full.zip"
|
||||||
|
[Papa_Sangre_aarch64]="${ipfsGateway}/ipfs/QmVGVXjZWXN3ETyBYGo244KMxzc37hAkFPNF3YnMeXD8Vv?filename=PapaSangre-1.0.7-aarch64.AppImage"
|
||||||
|
[Papa_Sangre_x86_64]="${ipfsGateway}/ipfs/QmQNrLLA3pDHJCiNHNRtzDRTULmZviRR25denhs9dv8aPE?filename=PapaSangre-1.0.7-x86_64.AppImage"
|
||||||
|
[Papa_Sangre_II_aarch64]="${ipfsGateway}/ipfs/QmPpHNg6qPSVWeN22nbWqJYE28XsV9wpBuYgHmezX2VxKX?filename=PapaSangreII-2026-09-29-aarch64.AppImage"
|
||||||
|
[Papa_Sangre_II_x86_64]="${ipfsGateway}/ipfs/QmXWQyqZD2cB6gjZQnETMTaspgfBQNLRC2Zska9vWk4PAp?filename=PapaSangreII-2026-09-29-x86_64.AppImage"
|
||||||
|
[The_Nightjar_aarch64]="${ipfsGateway}/ipfs/QmZFA9j3Jz5rX7wKpnMwssCs7CAni7yYP246MKBTF22SLg?filename=TheNightjar-2026-09-28-aarch64.AppImage"
|
||||||
|
[The_Nightjar_x86_64]="${ipfsGateway}/ipfs/QmNSG3ugpGCFkUWf7CHF3Jo4hjXc9QAVENEPamzAWaEyvs?filename=TheNightjar-2026-09-28-x86_64.AppImage"
|
||||||
|
[Soul_Trapper_aarch64]="${ipfsGateway}/ipfs/QmTH6kYq2sg7Ly5wk8Up11V98WQNBfDGz7JjiQ4XX52nH1?filename=SoulTrapper-1.1-1-aarch64.AppImage"
|
||||||
|
[Soul_Trapper_x86_64]="${ipfsGateway}/ipfs/QmVRJAkFnNULnVuLiZYNjzgYnj4c1eSvtLDX6ygesp69Dv?filename=SoulTrapper-1.1-1-x86_64.AppImage"
|
||||||
|
)
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC2154 # Paths and download helpers are supplied by the manager.
|
||||||
|
|
||||||
|
install_wickets() {
|
||||||
|
check_architecture x86_64
|
||||||
|
check_dependencies tar
|
||||||
|
|
||||||
|
local updateOnly="${1:-false}"
|
||||||
|
local gamePath="${installPath}/Wickets"
|
||||||
|
local metadataFile="Wickets-latest.json"
|
||||||
|
local releaseVersion assetName assetUrl stagingPath
|
||||||
|
|
||||||
|
if [[ "${updateOnly}" == true ]] && [[ ! -f "${gamePath}/wickets" ]]; then
|
||||||
|
ui_msgbox "Wickets" "Linux Game Manager" "Wickets is not installed. Please install it with -i first."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Always resolve the current release, even when the archive is cached.
|
||||||
|
rm -f "${cache}/${metadataFile}" || return 1
|
||||||
|
download_named "${metadataFile}" "https://api.github.com/repos/orinks-games/wickets/releases/latest" || return 1
|
||||||
|
if ! releaseVersion="$(jq -er '.tag_name | select(test("^v[0-9]+\\.[0-9]+\\.[0-9]+$"))' "${cache}/${metadataFile}")"; then
|
||||||
|
ui_msgbox "Wickets" "Linux Game Manager" "Could not determine the latest Wickets release. Please try again later."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
assetName="wickets-${releaseVersion#v}-linux-x64.tar.gz"
|
||||||
|
if ! assetUrl="$(jq -er --arg name "${assetName}" '.assets[] | select(.name == $name) | .browser_download_url' "${cache}/${metadataFile}")" ||
|
||||||
|
[[ "${assetUrl}" != "https://github.com/orinks-games/wickets/releases/download/${releaseVersion}/${assetName}" ]]; then
|
||||||
|
ui_msgbox "Wickets" "Linux Game Manager" "The latest Wickets release has no supported Linux x64 archive."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${updateOnly}" == true ]] && [[ -f "${gamePath}/.lgm-version" ]] &&
|
||||||
|
[[ "$(< "${gamePath}/.lgm-version")" == "${releaseVersion}" ]]; then
|
||||||
|
ui_msgbox "Wickets" "Linux Game Manager" "Wickets ${releaseVersion#v} is already up to date."
|
||||||
|
# The manager otherwise displays a generic update-success message.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
download_named "${assetName}" "${assetUrl}" || return 1
|
||||||
|
stagingPath="$(mktemp -d "${cache}/wickets.XXXXXX")" || return 1
|
||||||
|
if ! tar -xzf "${cache}/${assetName}" --strip-components=1 -C "${stagingPath}" ||
|
||||||
|
[[ ! -f "${stagingPath}/wickets" ]] || [[ ! -f "${stagingPath}/sounds.pak" ]]; then
|
||||||
|
rm -rf "${stagingPath}"
|
||||||
|
ui_msgbox "Wickets" "Linux Game Manager" "Could not extract the Wickets archive. The installed game has not been changed."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Overlay release files so the portable saves directory is preserved.
|
||||||
|
if ! mkdir -p "${gamePath}" || ! cp -a "${stagingPath}/." "${gamePath}/" ||
|
||||||
|
! chmod +x "${gamePath}/wickets" ||
|
||||||
|
! printf '%s\n' "${releaseVersion}" > "${gamePath}/.lgm-version"; then
|
||||||
|
rm -rf "${stagingPath}"
|
||||||
|
ui_msgbox "Wickets" "Linux Game Manager" "Could not install Wickets. Please check free space and directory permissions, then try again."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
rm -rf "${stagingPath}"
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
audioDefenceUrl="${ipfs[Audio_Defence_$(uname -m)]}"
|
||||||
|
downloadFile="${audioDefenceUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
[[ -n "${downloadFile}" && "${downloadFile}" != "${audioDefenceUrl}" ]] || downloadFile="AudioDefence-$(uname -m).AppImage"
|
||||||
|
download_named "${downloadFile}" "${audioDefenceUrl}"
|
||||||
|
mkdir -p "${installPath}/Audio_Defence"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${installPath}/Audio_Defence/AudioDefence.AppImage"
|
||||||
|
find "${installPath}/Audio_Defence" -maxdepth 1 -type f -name 'AudioDefence-*.AppImage' -delete
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
check_architecture x86_64
|
||||||
|
get_installer "christmas_dash_linux.zip" "https://tunmi13.itch.io/christmas-dash"
|
||||||
|
unzip -d "${installPath}" "${cache}/christmas_dash_linux.zip"
|
||||||
|
if [[ -d "${installPath}/Christmas Dash/christmas_dash_linux" ]]; then
|
||||||
|
rm -rf "${installPath}/christmas_dash_linux"
|
||||||
|
mv -v "${installPath}/Christmas Dash/christmas_dash_linux" "${installPath}/christmas_dash_linux"
|
||||||
|
rmdir "${installPath}/Christmas Dash" 2> /dev/null || true
|
||||||
|
fi
|
||||||
|
chmod +x "${installPath}/christmas_dash_linux/game.bin"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
check_architecture x86_64
|
||||||
|
installPath="${installPath:-${HOME}/.local/games}"
|
||||||
|
cache="${cache:-${XDG_CACHE_HOME:-$HOME/.cache}/linux-game-manager}"
|
||||||
|
download "https://samtupy.com/games/cm.tar.gz"
|
||||||
|
mkdir -p "${installPath}/Constant Motion"
|
||||||
|
tar -xzf "${cache}/cm.tar.gz" -C "${installPath}/Constant Motion"
|
||||||
|
chmod +x "${installPath}/Constant Motion/cm"
|
||||||
+12
-18
@@ -1,4 +1,5 @@
|
|||||||
tobyVersion="8-0"
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
tobyVersion="9.0"
|
||||||
mkdir -p "${installPath}/doom"
|
mkdir -p "${installPath}/doom"
|
||||||
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)"
|
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)"
|
||||||
if [[ ${#doomPath} -lt 5 ]]; then
|
if [[ ${#doomPath} -lt 5 ]]; then
|
||||||
@@ -17,27 +18,20 @@ if [[ ${#doomPath} -lt 5 ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)"
|
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)"
|
||||||
if ! [[ -e "${installPath}/doom/DoomMetalVol6.wad" ]] && ! [[ -e "${installPath}/doom/DoomMetalVol7.wad" ]]; then
|
|
||||||
alert
|
|
||||||
choice=$(ui_menu "Doom Metal Selection" "Doom Metal Selection" "Would you like Doom Metal Volume 6 or 7?" "6" "Doom Metal Volume 6" "7" "Doom Metal Volume 7" "none" "None")
|
|
||||||
case "$choice" in
|
|
||||||
"6")
|
|
||||||
download "${ipfsGateway}/ipfs/QmSzWKtP3wPvzn5GNd9F7n4RAhkFHxh2UHxXGefiAufwQW?filename=DoomMetalVol6.wad"
|
|
||||||
;;
|
|
||||||
"7")
|
|
||||||
download "${ipfsGateway}/ipfs/QmfXkz3tzicKGfhcYSiWUZkjkDKP2aVp53Y49n127wMr7D?filename=DoomMetalVol7.wad"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
# The url breaks the normal download function
|
# The url breaks the normal download function
|
||||||
download_named "keyshare-universal.pk3" "https://forum.zdoom.org/download/file.php?id=42262"
|
download_named "keyshare-universal.pk3" "https://forum.zdoom.org/download/file.php?id=42262"
|
||||||
download "${ipfsGateway}/ipfs/QmRSyAGQPaRtWwH9aT87Q8rKini9GYXac92B9EkBZJtbJ1?filename=TobyAccessibilityMod_V${tobyVersion}.zip"
|
download "${ipfs[FreeDoom]}"
|
||||||
[[ -e "${cache}/DoomMetalVol6.wad" ]] && mv "${cache}/DoomMetalVol6.wad" "${installPath}/doom"
|
unzip -n -d "${installPath}/doom" "${cache}/toby_doom_${tobyVersion}_full.zip"
|
||||||
[[ -e "${cache}/DoomMetalVol7.wad" ]] && mv "${cache}/DoomMetalVol7.wad" "${installPath}/doom"
|
# Move contents from nested folder up one directory (including hidden files)
|
||||||
unzip -n -d "${installPath}/doom" "${cache}/TobyAccessibilityMod_V${tobyVersion}.zip"
|
shopt -s dotglob
|
||||||
|
mv "${installPath}/doom/TobyAccessibilityMod_Version9"*/* "${installPath}/doom/"
|
||||||
|
shopt -u dotglob
|
||||||
|
# Remove the now-empty nested folder
|
||||||
|
rmdir "${installPath}/doom/TobyAccessibilityMod_Version9"*
|
||||||
#unzip -n -d "${installPath}/doom" "${cache}/OpMDK_ForV${tobyVersion}.zip"
|
#unzip -n -d "${installPath}/doom" "${cache}/OpMDK_ForV${tobyVersion}.zip"
|
||||||
cp -v "${cache}/keyshare-universal.pk3" "${installPath}/doom"
|
cp -v "${cache}/keyshare-universal.pk3" "${installPath}/doom"
|
||||||
rm -fv "${installPath}/doom/"*.{ahk,bat,exe,dll,ps1}
|
rm -fv "${installPath}/doom/"*.{bat,exe,dll,ps1}
|
||||||
|
rm -rfv "${installPath}/doom/_internal"
|
||||||
#if [[ -e /usr/share/doom/blasphem.wad ]]; then
|
#if [[ -e /usr/share/doom/blasphem.wad ]]; then
|
||||||
#ln -s /usr/share/doom/blasphem.wad "${installPath}/doom/"
|
#ln -s /usr/share/doom/blasphem.wad "${installPath}/doom/"
|
||||||
#fi
|
#fi
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
check_architecture x86_64 aarch64
|
||||||
|
# Doubles both as the URl and the file name, which is cconvenient since I can be lazy.
|
||||||
|
url="https://github.com/orinks-games/Freight-Fate/releases/download/v1.9.4/FreightFate-v1.9.4-linux-$(uname -m).AppImage"
|
||||||
|
download "${url}"
|
||||||
|
mkdir -p "${installPath}/Freight_Fate"
|
||||||
|
install -vm 0755 "${cache}/FreightFate-v1.9.4-linux-$(uname -m).AppImage" "${installPath}/Freight_Fate/Freight_Fate.appimage"
|
||||||
@@ -1,2 +1,6 @@
|
|||||||
check_dependencies python-pygame:pygame python-xdg:xdg python-pyperclip:pyperclip python-requests:requests python-setproctitle:setproctitle
|
check_dependencies git python-pygame:pygame python-xdg:xdg python-pyperclip:pyperclip python-requests:requests python-setproctitle:setproctitle
|
||||||
git -C "${installPath}" clone --recurse-submodules https://gitlab.com/stormdragon2976/monkeyspank.git
|
# shellcheck disable=SC2154 # installPath is supplied by the manager.
|
||||||
|
if ! git -C "${installPath}" clone --recurse-submodules https://git.stormux.org/storm/monkeyspank.git; then
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Could not clone Monkey Spank and its required submodules."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
papaSangreIIUrl="${ipfs[Papa_Sangre_II_$(uname -m)]}"
|
||||||
|
downloadFile="${papaSangreIIUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
download_named "$downloadFile" "$papaSangreIIUrl"
|
||||||
|
mkdir -p "${installPath}/Papa_Sangre_II"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${installPath}/Papa_Sangre_II/PapaSangreII.AppImage"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
papaSangreUrl="${ipfs[Papa_Sangre_$(uname -m)]}"
|
||||||
|
downloadFile="${papaSangreUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
download_named "$downloadFile" "$papaSangreUrl"
|
||||||
|
mkdir -p "${installPath}/Papa_Sangre"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${installPath}/Papa_Sangre/PapaSangre.AppImage"
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
check_dependencies git uv python-speechd:speechd
|
||||||
|
|
||||||
|
# shellcheck disable=SC2154 # set by linux-game-manager.sh
|
||||||
|
gameRoot="${installPath}/PlayPalace11"
|
||||||
|
desktopPath="${gameRoot}/clients/desktop"
|
||||||
|
hostPythonDir="${desktopPath}/.host-python"
|
||||||
|
speechdFilePath=""
|
||||||
|
speechdCopySourcePath=""
|
||||||
|
|
||||||
|
if [[ -e "${gameRoot}" ]]; then
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "\"${gameRoot}\" already exists. Remove it first or choose a different game."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${installPath}" || {
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Could not create ${installPath}."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! git -C "${installPath}" clone "https://github.com/XGDevGroup/PlayPalace11.git"; then
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Could not clone Play Palace from GitHub."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! pushd "${desktopPath}" > /dev/null; then
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Could not find desktop client path at ${desktopPath}."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! uv sync; then
|
||||||
|
popd > /dev/null || exit 1
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "uv sync failed for Play Palace."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
popd > /dev/null || exit 1
|
||||||
|
|
||||||
|
speechdFilePath="$(python3 -c 'import pathlib,speechd; print(pathlib.Path(speechd.__file__).resolve())' 2> /dev/null)"
|
||||||
|
if [[ -z "${speechdFilePath}" ]]; then
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Could not import python module speechd from host Python.\nInstall speech-dispatcher python bindings and try again."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${speechdFilePath##*/}" == "__init__.py" ]]; then
|
||||||
|
speechdCopySourcePath="${speechdFilePath%/*}"
|
||||||
|
elif [[ "${speechdFilePath##*/}" == "speechd.py" ]]; then
|
||||||
|
speechdCopySourcePath="${speechdFilePath}"
|
||||||
|
else
|
||||||
|
speechdCopySourcePath="${speechdFilePath}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [[ -r "${speechdCopySourcePath}" ]]; then
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Could not read speechd python binding at ${speechdCopySourcePath}."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${hostPythonDir}" || {
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Could not create ${hostPythonDir}."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ -d "${speechdCopySourcePath}" ]]; then
|
||||||
|
if ! cp -a "${speechdCopySourcePath}" "${hostPythonDir}/"; then
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Could not copy speechd package into ${hostPythonDir}."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
elif ! cp -a "${speechdCopySourcePath}" "${hostPythonDir}/speechd.py"; then
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Could not copy speechd module into ${hostPythonDir}."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and cache are supplied by the manager.
|
||||||
|
check_architecture x86_64
|
||||||
|
check_dependencies python-speechd:speechd
|
||||||
|
download "https://github.com/rsgames-zgp/rsgames-client-releases/releases/download/v2.3/rsg-linux-x86_64.tar.gz"
|
||||||
|
mkdir -p "${installPath}/RS_Games" || exit 1
|
||||||
|
tar -xzf "${cache}/rsg-linux-x86_64.tar.gz" --strip-components=1 -C "${installPath}/RS_Games" || exit 1
|
||||||
|
# Keep bundled ALSA when it works; use system ALSA only after verifying it.
|
||||||
|
python3 "${scriptRoot}/.files/rs-games-alsa.py" "${installPath}/RS_Games" || exit 1
|
||||||
|
chmod +x "${installPath}/RS_Games/rsg" || exit 1
|
||||||
|
# The frozen client omits speechd and cannot import host site-packages.
|
||||||
|
speechdPath="$(python3 -c 'import pathlib, speechd; print(pathlib.Path(speechd.__file__).resolve().parent)')" || exit 1
|
||||||
|
mkdir -p "${installPath}/RS_Games/_internal/speechd" || exit 1
|
||||||
|
cp "${speechdPath}/"*.py "${installPath}/RS_Games/_internal/speechd/" || exit 1
|
||||||
|
python3 "${scriptRoot}/.files/rs-games-audio.py" "${installPath}/RS_Games" || exit 1
|
||||||
+22
-24
@@ -1,29 +1,22 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and cache are set by linux-game-manager.sh
|
||||||
check_architecture x86_64
|
check_architecture x86_64
|
||||||
alert
|
alert "Game Installer" "Game Installer" "Please note this requires the game to be available either in your Steam library or as the installer purchased from gog.com.\n\nIf using the gog.com installer, please use the default path when prompted."
|
||||||
ui_msgbox "Game Installer" "Game Installer" "Please note this requires the game to be available either in your Steam library or as the installer purchased from gog.com.\n\nIf using the gog.com installer, please use the default path when prompted."
|
|
||||||
installMethod=$(ui_menu "Installation Method" "Installation Method" "Select installation method" "gog" "GOG" "steam" "Steam")
|
installMethod=$(ui_menu "Installation Method" "Installation Method" "Select installation method" "gog" "GOG" "steam" "Steam")
|
||||||
if [[ "$installMethod" == "steam" ]]; then
|
|
||||||
installationMethod=1
|
|
||||||
else
|
|
||||||
installationMethod=0
|
|
||||||
fi
|
|
||||||
appId="646570"
|
appId="646570"
|
||||||
gogFileName="slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh"
|
gogFileName="slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh"
|
||||||
if [[ $installMethod -eq 1 ]]; then
|
if [[ "$installMethod" == "steam" ]]; then
|
||||||
# Steam Installation
|
# Steam Installation
|
||||||
check_dependencies steamcmd
|
check_dependencies steamcmd
|
||||||
steamUser=$(ui_inputbox "Game Installer" "Game Installer" "Please enter Steam user name:" "")
|
steamUser=$(ui_inputbox "Game Installer" "Game Installer" "Please enter Steam user name:" "")
|
||||||
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire" +login "$steamUser" +app_update "$appId" +quit
|
if ! steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire" +login "$steamUser" +app_update "$appId" +quit; then
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
ui_msgbox "Game Installer" "Game Installer" "Error installing game through Steam."
|
ui_msgbox "Game Installer" "Game Installer" "Error installing game through Steam."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# GOG Installation
|
# GOG Installation
|
||||||
get_installer "$gogFileName" "https://www.gog.com/en/game/slay_the_spire"
|
get_installer "$gogFileName" "https://www.gog.com/en/game/slay_the_spire"
|
||||||
DISPLAY="" find ~/Downloads -maxdepth 1 -type f -name "$gogFileName" -exec bash "{}" \; ||
|
if DISPLAY="" find ~/Downloads -maxdepth 1 -type f -name "$gogFileName" -exec bash "{}" \; ||
|
||||||
DISPLAY="" find ~/Desktop -maxdepth 1 -type f -name "$gogFileName" -exec bash "{}" \;
|
DISPLAY="" find ~/Desktop -maxdepth 1 -type f -name "$gogFileName" -exec bash "{}" \;; then
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
ln -sf "${HOME}/GOG Games/Slay the Spire/game" "${installPath}/SlayTheSpire" ||
|
ln -sf "${HOME}/GOG Games/Slay the Spire/game" "${installPath}/SlayTheSpire" ||
|
||||||
{ ui_msgbox "Game Installer" "Game Installer" "Error creating link to game directory."
|
{ ui_msgbox "Game Installer" "Game Installer" "Error creating link to game directory."
|
||||||
exit 1; }
|
exit 1; }
|
||||||
@@ -50,24 +43,29 @@ declare -A modsMap=(
|
|||||||
[achievement enabler]=1692554109
|
[achievement enabler]=1692554109
|
||||||
[say the spire]=2239220106
|
[say the spire]=2239220106
|
||||||
)
|
)
|
||||||
installString=""
|
declare -a installArgs=()
|
||||||
for modId in ${modsMap[@]} ; do
|
for modId in "${modsMap[@]}" ; do
|
||||||
installString="$installString +workshop_download_item $appId $modId"
|
installArgs+=("+workshop_download_item" "$appId" "$modId")
|
||||||
done
|
done
|
||||||
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire/" +login anonymous $installString +quit
|
if ! steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire/" +login anonymous "${installArgs[@]}" +quit; then
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
ui_msgbox "Game Installer" "Game Installer" "Error installing required mods. Some accessibility features may not be available."
|
ui_msgbox "Game Installer" "Game Installer" "Error installing required mods. Some accessibility features may not be available."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mkdir -p "$HOME/.local/games/SlayTheSpire/mods"
|
mkdir -p "$HOME/.local/games/SlayTheSpire/mods"
|
||||||
for modName in "${!modsMap[@]}" ; do
|
for modName in "${!modsMap[@]}" ; do
|
||||||
if [[ "$modName" == "mod the spire" ]]; then
|
if [[ "$modName" == "mod the spire" ]]; then
|
||||||
ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${modsMap[$modName]}"/* "$HOME/.local/games/SlayTheSpire/"
|
if ! ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${modsMap[$modName]}"/* "$HOME/.local/games/SlayTheSpire/"; then
|
||||||
|
if [[ "$modName" == "say the spire" ]]; then
|
||||||
|
ui_msgbox "Game Installer" "Game Installer" "Error installing SayTheSpire mod. Screen reader support will not be available."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${modsMap[$modName]}"/* "$HOME/.local/games/SlayTheSpire/mods/"
|
if ! ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${modsMap[$modName]}"/* "$HOME/.local/games/SlayTheSpire/mods/"; then
|
||||||
fi
|
if [[ "$modName" == "say the spire" ]]; then
|
||||||
if [[ $? -ne 0 ]] && [[ "$modName" == "say the spire" ]]; then
|
ui_msgbox "Game Installer" "Game Installer" "Error installing SayTheSpire mod. Screen reader support will not be available."
|
||||||
ui_msgbox "Game Installer" "Game Installer" "Error installing SayTheSpire mod. Screen reader support will not be available."
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
soulTrapperUrl="${ipfs[Soul_Trapper_$(uname -m)]}"
|
||||||
|
downloadFile="${soulTrapperUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
download_named "$downloadFile" "$soulTrapperUrl"
|
||||||
|
mkdir -p "${installPath}/Soul_Trapper"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${installPath}/Soul_Trapper/SoulTrapper.AppImage"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and cache are set by linux-game-manager.sh
|
||||||
check_architecture x86_64
|
check_architecture x86_64
|
||||||
DISPLAY=""
|
DISPLAY=""
|
||||||
alert
|
alert "Game Installer" "Game Installer" "Please select the default path when prompted by the installer."
|
||||||
ui_msgbox "Game Installer" "Game Installer" "Please select the default path when prompted by the installer."
|
|
||||||
get_installer "stardew_valley_1_5_6_1988831614_53040.sh" "https://www.gog.com/game/stardew_valley"
|
get_installer "stardew_valley_1_5_6_1988831614_53040.sh" "https://www.gog.com/game/stardew_valley"
|
||||||
bash "${cache}/stardew_valley_1_5_6_1988831614_53040.sh" ||
|
bash "${cache}/stardew_valley_1_5_6_1988831614_53040.sh" ||
|
||||||
{ ui_msgbox "Game Installer" "Game Installer" "Error installing game."
|
{ ui_msgbox "Game Installer" "Game Installer" "Error installing game."
|
||||||
@@ -10,8 +10,7 @@ smapiVersion="3.18.4"
|
|||||||
download "https://github.com/Pathoschild/SMAPI/releases/download/${smapiVersion}/SMAPI-${smapiVersion}-installer.zip" "https://stormgames.wolfe.casa/downloads/stardew-valley/Mods.tar.xz"
|
download "https://github.com/Pathoschild/SMAPI/releases/download/${smapiVersion}/SMAPI-${smapiVersion}-installer.zip" "https://stormgames.wolfe.casa/downloads/stardew-valley/Mods.tar.xz"
|
||||||
smapiTmp="$(mktemp -d)"
|
smapiTmp="$(mktemp -d)"
|
||||||
unzip "${cache}/SMAPI-${smapiVersion}-installer.zip" -d "$smapiTmp"
|
unzip "${cache}/SMAPI-${smapiVersion}-installer.zip" -d "$smapiTmp"
|
||||||
alert
|
alert "Game Installer" "Game Installer" "Preparing to install mods. Please select the same path as before when prompted.\n\nWhen it says SMAPI has been installed, press enter to finish installation."
|
||||||
ui_msgbox "Game Installer" "Game Installer" "Preparing to install mods. Please select the same path as before when prompted.\n\nWhen it says SMAPI has been installed, press enter to finish installation."
|
|
||||||
bash "${smapiTmp}/SMAPI ${smapiVersion} installer/install on Linux.sh"
|
bash "${smapiTmp}/SMAPI ${smapiVersion} installer/install on Linux.sh"
|
||||||
ln -sf "${HOME}/GOG Games/Stardew Valley/game" "${installPath}/StardewValley"
|
ln -sf "${HOME}/GOG Games/Stardew Valley/game" "${installPath}/StardewValley"
|
||||||
tar -xvf "${cache}/Mods.tar.xz" -C "${installPath}/StardewValley/"
|
tar -xvf "${cache}/Mods.tar.xz" -C "${installPath}/StardewValley/"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and cache are set by linux-game-manager.sh
|
||||||
|
check_architecture x86_64
|
||||||
|
download "https://l-works.net/files/SuperLiam_linux.tar.gz"
|
||||||
|
tar -xzf "$cache/SuperLiam_linux.tar.gz" -C "${installPath}"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and cache are set by linux-game-manager.sh
|
||||||
|
check_architecture x86_64
|
||||||
|
download "https://l-works.net/files/tgtr_linux.tar.gz"
|
||||||
|
tar -xzf "$cache/tgtr_linux.tar.gz" -C "${installPath}"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
theNightjarUrl="${ipfs[The_Nightjar_$(uname -m)]}"
|
||||||
|
downloadFile="${theNightjarUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
download_named "$downloadFile" "$theNightjarUrl"
|
||||||
|
mkdir -p "${installPath}/The_Nightjar"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${installPath}/The_Nightjar/TheNightjar.AppImage"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and cache are set by linux-game-manager.sh
|
||||||
|
check_architecture x86_64
|
||||||
|
get_installer "the-omega-reach-linux-x64.zip" "https://shiftbacktick.itch.io/the-omega-reach"
|
||||||
|
mkdir -p "${installPath}/Omega Reach"
|
||||||
|
unzip -d "${installPath}/Omega Reach" "${cache}/the-omega-reach-linux-x64.zip"
|
||||||
|
chmod +x "${installPath}/Omega Reach/the-omega-reach"
|
||||||
|
chmod +x "${installPath}/Omega Reach/chrome-sandbox"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and cache are set by linux-game-manager.sh
|
||||||
check_architecture x86_64
|
check_architecture x86_64
|
||||||
get_installer "Ttc v3.2 linux.zip" "https://renzivan.itch.io/the-tornado-chicken"
|
get_installer "Ttc v3.2 linux.zip" "https://renzivan.itch.io/the-tornado-chicken"
|
||||||
unzip -d "${installPath}/The Tornado Chicken" "${cache}/Ttc v3.2 linux.zip"
|
unzip -d "${installPath}/The Tornado Chicken" "${cache}/Ttc v3.2 linux.zip"
|
||||||
chmod +x "${installPath}/The Tornado Chicken/Ttc"
|
chmod +x "${installPath}/The Tornado Chicken/Ttc"
|
||||||
alert
|
alert "Game Installer" "Game Installer" "Note: When the game first starts it will be playing very loud music with the built in suboptimal voice.\n\nYou are recommended to press page down several times to turn down the music, then go to settings and enable speech with screen reader, using speech dispatcher.\n\nYou may then press page up to set the music to your liking."
|
||||||
ui_msgbox "Game Installer" "Game Installer" "Note: When the game first starts it will be playing very loud music with the built in suboptimal voice.\n\nYou are recommended to press page down several times to turn down the music, then go to settings and enable speech with screen reader, using speech dispatcher.\n\nYou may then press page up to set the music to your liking."
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC2154 # set by linux-game-manager.sh
|
||||||
|
check_architecture x86_64
|
||||||
|
|
||||||
|
releaseMetadataFile="TopSpeed-release-build.json"
|
||||||
|
releaseMetadataPath="${cache}/${releaseMetadataFile}"
|
||||||
|
releaseMetadataUrl="https://api.github.com/repos/diamondStar35/top_speed/releases/tags/release-build"
|
||||||
|
assetPattern='^TopSpeed-linux-x64-Release-v-.*\.zip$'
|
||||||
|
|
||||||
|
rm -f "${releaseMetadataPath}"
|
||||||
|
download_named "${releaseMetadataFile}" "${releaseMetadataUrl}"
|
||||||
|
|
||||||
|
assetName="$(jq -r --arg assetPattern "${assetPattern}" '.assets[] | select(.name | test($assetPattern)) | .name' "${releaseMetadataPath}" | head -n 1)"
|
||||||
|
assetUrl="$(jq -r --arg assetPattern "${assetPattern}" '.assets[] | select(.name | test($assetPattern)) | .browser_download_url' "${releaseMetadataPath}" | head -n 1)"
|
||||||
|
|
||||||
|
if [[ -z "${assetName}" ]] || [[ -z "${assetUrl}" ]] || [[ "${assetName}" == "null" ]] || [[ "${assetUrl}" == "null" ]]; then
|
||||||
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Unable to find the latest Top Speed Linux download in the GitHub release metadata."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
download_named "${assetName}" "${assetUrl}"
|
||||||
|
mkdir -p "${installPath}/TopSpeed"
|
||||||
|
unzip -o -d "${installPath}/TopSpeed" "${cache}/${assetName}"
|
||||||
|
chmod +x "${installPath}/TopSpeed/TopSpeed"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and cache are set by linux-game-manager.sh
|
||||||
check_architecture x86_64
|
check_architecture x86_64
|
||||||
check_dependencies dmidecode
|
check_dependencies dmidecode
|
||||||
get_installer "upheaval-linux.zip" "https://leonegaming.itch.io/upheaval"
|
get_installer "upheaval-linux.zip" "https://leonegaming.itch.io/upheaval"
|
||||||
mkdir -p "${installPath}/Upheaval_Gui"
|
mkdir -p "${installPath}/Upheaval_Gui"
|
||||||
unzip -d "${installPath}/Upheaval_Gui" "${cache}/upheaval-linux.zip"
|
unzip -d "${installPath}/Upheaval_Gui" "${cache}/upheaval-linux.zip"
|
||||||
alert
|
alert "Game Installer" "Game Installer" "To enable accessibility, press shift t when the game starts."
|
||||||
ui_msgbox "Game Installer" "Game Installer" "To enable accessibility, press shift t when the game starts."
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and cache are set by linux-game-manager.sh
|
||||||
check_architecture x86_64
|
check_architecture x86_64
|
||||||
get_installer "Wp v3.0 linux.zip" "https://psyra-productions.itch.io/wheels-of-prio"
|
get_installer "Wp v3.0 linux.zip" "https://psyra-productions.itch.io/wheels-of-prio"
|
||||||
unzip -d "${installPath}/Wheels of Prio" "${cache}/Wp v3.0 linux.zip"
|
unzip -d "${installPath}/Wheels of Prio" "${cache}/Wp v3.0 linux.zip"
|
||||||
chmod +x "${installPath}/Wheels of Prio/Wp"
|
chmod +x "${installPath}/Wheels of Prio/Wp"
|
||||||
alert
|
alert "Game Installer" "Game Installer" "Note: When the game first starts it will be playing very loud music with the built in suboptimal voice.\n\nYou are recommended to press page down several times to turn down the music, then go to settings and enable speech with screen reader, using speech dispatcher.\n\nYou may then press page up to set the music to your liking."
|
||||||
ui_msgbox "Game Installer" "Game Installer" "Note: When the game first starts it will be playing very loud music with the built in suboptimal voice.\n\nYou are recommended to press page down several times to turn down the music, then go to settings and enable speech with screen reader, using speech dispatcher.\n\nYou may then press page up to set the music to your liking."
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
local arch=$(uname -m)
|
||||||
|
local gameName
|
||||||
|
|
||||||
|
if [[ "$arch" == "aarch64" ]]; then
|
||||||
|
gameName="wicked_quest-linux-aarch64.zip"
|
||||||
|
else
|
||||||
|
gameName="wicked_quest-linux-x86_64.zip"
|
||||||
|
fi
|
||||||
|
|
||||||
|
get_installer "$gameName" "https://stormdragon2976.itch.io/wicked-quest"
|
||||||
|
mkdir -p "${installPath}/Wicked_Quest"
|
||||||
|
unzip -d "${installPath}/" "${cache}/$gameName"
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC2154 # scriptRoot is supplied by the manager.
|
||||||
|
# shellcheck source=.includes/wickets.sh
|
||||||
|
source "${scriptRoot}/.includes/wickets.sh"
|
||||||
|
install_wickets false || exit 1
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
gamePath="${installPath}/Audio_Defence"
|
||||||
|
soundArgs=()
|
||||||
|
soundType="$(ui_menu "Select Sound Type" "Linux Game Manager" "Please select one" \
|
||||||
|
"hrtf" "hrtf" \
|
||||||
|
"stereo" "stereo")"
|
||||||
|
[[ -n "${soundType}" ]] || exit 0
|
||||||
|
case "${soundType}" in
|
||||||
|
hrtf) ;;
|
||||||
|
stereo) soundArgs+=(--no-hrtf) ;;
|
||||||
|
*) exit 0 ;;
|
||||||
|
esac
|
||||||
|
run_with_optional_gamemode "${gamePath}/AudioDefence.AppImage" ${soundArgs[@]+"${soundArgs[@]}"}
|
||||||
@@ -64,4 +64,4 @@ configure_audio
|
|||||||
configure_webkit
|
configure_webkit
|
||||||
set_sound_device
|
set_sound_device
|
||||||
pushd "${installPath}/AudioQuake"
|
pushd "${installPath}/AudioQuake"
|
||||||
./AudioQuake
|
run_with_optional_gamemode ./AudioQuake
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
check_architecture x86_64
|
check_architecture x86_64
|
||||||
pushd "${installPath}/BallBouncer"
|
pushd "${installPath}/BallBouncer"
|
||||||
${fex}./BallBouncer
|
run_with_optional_gamemode ${fex}./BallBouncer
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
gameDir="${installPath}/christmas_dash_linux"
|
||||||
|
gameExecutable="${gameDir}/game.bin"
|
||||||
|
if [[ ! -d "$gameDir" ]]; then
|
||||||
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Christmas Dash is not installed."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ ! -x "$gameExecutable" ]]; then
|
||||||
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Unable to find ${gameExecutable}."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
pushd "${gameDir}"
|
||||||
|
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
|
||||||
|
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
|
||||||
|
run_with_optional_gamemode "${gameExecutable}"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
check_architecture x86_64
|
||||||
|
gameExecutable="${installPath}/Constant Motion/cm"
|
||||||
|
pushd "${installPath}/Constant Motion"
|
||||||
|
run_with_optional_gamemode ${fex}"${gameExecutable}"
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
pushd "${installPath}"
|
pushd "${installPath}"
|
||||||
"${installPath}/FS2_3.0_Linux/fs2.x86_64" "-ESpeakApplication=espeak-ng"
|
run_with_optional_gamemode "${installPath}/FS2_3.0_Linux/fs2.x86_64" "-ESpeakApplication=espeak-ng"
|
||||||
@@ -8,4 +8,4 @@ if ! [[ -d "toby-doom-launcher" ]]; then
|
|||||||
else
|
else
|
||||||
git -C "${gamePath}/toby-doom-launcher" pull
|
git -C "${gamePath}/toby-doom-launcher" pull
|
||||||
fi
|
fi
|
||||||
"toby-doom-launcher/Toby Doom Launcher.py"
|
run_with_optional_gamemode "toby-doom-launcher/Toby Doom Launcher.py"
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
gamePath="${installPath}/Freight_Fate"
|
||||||
|
run_with_optional_gamemode "${gamePath}/Freight_Fate.appimage"
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
pushd "${installPath}"
|
# shellcheck disable=SC2154 # installPath is supplied by the manager.
|
||||||
"${installPath}/monkeyspank/monkeyspank"
|
gamePath="${installPath}/monkeyspank"
|
||||||
|
cd "${gamePath}" || exit 1
|
||||||
|
./monkeyspank
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
open_url "https://play.oriolgomez.com/"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
gamePath="${installPath}/Papa_Sangre_II"
|
||||||
|
run_with_optional_gamemode "${gamePath}/PapaSangreII.AppImage"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
gamePath="${installPath}/Papa_Sangre"
|
||||||
|
run_with_optional_gamemode "${gamePath}/PapaSangre.AppImage"
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
pushd "${installPath}"
|
pushd "${installPath}"
|
||||||
"${installPath}/periphery-synthetic-ep/periphery-synthetic-ep"
|
run_with_optional_gamemode "${installPath}/periphery-synthetic-ep/periphery-synthetic-ep"
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
check_dependencies uv
|
||||||
|
|
||||||
|
# shellcheck disable=SC2154 # set by linux-game-manager.sh
|
||||||
|
gamePath="${installPath}/PlayPalace11/clients"
|
||||||
|
desktopPath="${gamePath}/desktop"
|
||||||
|
hostPythonDir="${desktopPath}/.host-python"
|
||||||
|
|
||||||
|
if ! [[ -d "${desktopPath}" ]]; then
|
||||||
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Play Palace is not installed at ${desktopPath}."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d "${hostPythonDir}" ]]; then
|
||||||
|
export PYTHONPATH="${hostPythonDir}${PYTHONPATH:+:${PYTHONPATH}}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd "${desktopPath}" || exit 1
|
||||||
|
run_with_optional_gamemode uv run python client.py
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath and fex are supplied by the manager.
|
||||||
|
check_architecture x86_64
|
||||||
|
gamePath="${installPath}/RS_Games"
|
||||||
|
cd "${gamePath}" || exit 1
|
||||||
|
# shellcheck disable=SC2086 # fex intentionally expands to an optional command prefix.
|
||||||
|
run_with_optional_gamemode ${fex}./rsg
|
||||||
@@ -27,7 +27,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
pushd "${HOME}/.local/games/SlayTheSpire"
|
pushd "${HOME}/.local/games/SlayTheSpire"
|
||||||
./MTS.sh --profile "$currentProfile"
|
run_with_optional_gamemode ./MTS.sh --profile "$currentProfile"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
gamePath="${installPath}/Soul_Trapper"
|
||||||
|
run_with_optional_gamemode "${gamePath}/SoulTrapper.AppImage"
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
pushd "${installPath}"
|
pushd "${installPath}"
|
||||||
"${installPath}/Soulblaze/Soulblaze.x86_64"
|
run_with_optional_gamemode "${installPath}/Soulblaze/Soulblaze.x86_64"
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
pushd "${installPath}"
|
pushd "${installPath}"
|
||||||
"${installPath}/StardewValley/StardewValley"
|
run_with_optional_gamemode "${installPath}/StardewValley/StardewValley"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
check_architecture x86_64
|
||||||
|
gamePath="${installPath}/Super Liam"
|
||||||
|
pushd "${gamePath}"
|
||||||
|
run_with_optional_gamemode ${fex}./SuperLiam
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
pushd "${installPath}"
|
pushd "${installPath}"
|
||||||
"${installPath}/System_Fault/system-fault-linux-x86_64.AppImage"
|
run_with_optional_gamemode "${installPath}/System_Fault/system-fault-linux-x86_64.AppImage"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
check_architecture x86_64
|
||||||
|
gamePath="${installPath}/The Great Toy Robbery"
|
||||||
|
pushd "${gamePath}"
|
||||||
|
run_with_optional_gamemode ${fex}./tgtr
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
gamePath="${installPath}/The_Nightjar"
|
||||||
|
run_with_optional_gamemode "${gamePath}/TheNightjar.AppImage"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath is set by linux-game-manager.sh
|
||||||
|
gamePath="${installPath}/Omega Reach"
|
||||||
|
pushd "${gamePath}" || return 1
|
||||||
|
run_with_optional_gamemode "${gamePath}/the-omega-reach"
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
check_architecture x86_64
|
check_architecture x86_64
|
||||||
pushd "${installPath}/The Tornado Chicken"
|
pushd "${installPath}/The Tornado Chicken"
|
||||||
${fex}./Ttc
|
run_with_optional_gamemode ${fex}./Ttc
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC2154 # set by linux-game-manager.sh
|
||||||
|
gameExecutable="${installPath}/TopSpeed/TopSpeed"
|
||||||
|
gameDir="${gameExecutable%/*}"
|
||||||
|
if [[ ! -d "$gameDir" ]]; then
|
||||||
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Top Speed is not installed."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ ! -x "$gameExecutable" ]]; then
|
||||||
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Unable to find ${gameExecutable}."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
pushd "${gameDir}" || return 1
|
||||||
|
run_with_optional_gamemode "${gameExecutable}"
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
pushd "${installPath}"
|
pushd "${installPath}"
|
||||||
"${installPath}/Upheaval_Gui/Upheaval"
|
run_with_optional_gamemode "${installPath}/Upheaval_Gui/Upheaval"
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
check_architecture x86_64
|
check_architecture x86_64
|
||||||
pushd "${installPath}/Wheels of Prio"
|
pushd "${installPath}/Wheels of Prio"
|
||||||
${fex}./Wp
|
run_with_optional_gamemode ${fex}./Wp
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
local arch=$(uname -m)
|
||||||
|
if [[ "$arch" == "aarch64" ]]; then
|
||||||
|
pushd "${installPath}/wicked_quest-linux-aarch64"
|
||||||
|
else
|
||||||
|
pushd "${installPath}/wicked_quest-linux-x86_64"
|
||||||
|
fi
|
||||||
|
run_with_optional_gamemode ./wicked_quest
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # installPath is supplied by the manager.
|
||||||
|
gamePath="${installPath}/Wickets"
|
||||||
|
cd "${gamePath}" || exit 1
|
||||||
|
run_with_optional_gamemode ./wickets
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
pushd "${installPath}"
|
pushd "${installPath}"
|
||||||
"${installPath}/${pkgname%.*}/Zombowl"
|
run_with_optional_gamemode "${installPath}/${pkgname%.*}/Zombowl"
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
run_update() {
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
local audioDefenceUrl="${ipfs[Audio_Defence_$(uname -m)]}"
|
||||||
|
local downloadFile="${audioDefenceUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
[[ -n "${downloadFile}" && "${downloadFile}" != "${audioDefenceUrl}" ]] || \
|
||||||
|
downloadFile="AudioDefence-$(uname -m).AppImage"
|
||||||
|
|
||||||
|
# download_named reads this dynamically scoped flag.
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
local redownload=true
|
||||||
|
download_named "${downloadFile}" "${audioDefenceUrl}"
|
||||||
|
|
||||||
|
local gamePath="${installPath}/Audio_Defence"
|
||||||
|
mkdir -p "${gamePath}"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${gamePath}/AudioDefence.AppImage.new"
|
||||||
|
mv -v "${gamePath}/AudioDefence.AppImage.new" "${gamePath}/AudioDefence.AppImage"
|
||||||
|
find "${gamePath}" -maxdepth 1 -type f -name 'AudioDefence-*.AppImage' -delete
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
run_update() {
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
local papaSangreIIUrl="${ipfs[Papa_Sangre_II_$(uname -m)]}"
|
||||||
|
local downloadFile="${papaSangreIIUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
|
||||||
|
# download_named reads this dynamically scoped flag.
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
local redownload=true
|
||||||
|
download_named "$downloadFile" "$papaSangreIIUrl"
|
||||||
|
|
||||||
|
local gamePath="${installPath}/Papa_Sangre_II"
|
||||||
|
mkdir -p "$gamePath"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${gamePath}/PapaSangreII.AppImage.new"
|
||||||
|
mv -v "${gamePath}/PapaSangreII.AppImage.new" "${gamePath}/PapaSangreII.AppImage"
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
run_update() {
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
local papaSangreUrl="${ipfs[Papa_Sangre_$(uname -m)]}"
|
||||||
|
local downloadFile="${papaSangreUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
|
||||||
|
# download_named reads this dynamically scoped flag.
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
local redownload=true
|
||||||
|
download_named "$downloadFile" "$papaSangreUrl"
|
||||||
|
|
||||||
|
local gamePath="${installPath}/Papa_Sangre"
|
||||||
|
mkdir -p "$gamePath"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${gamePath}/PapaSangre.AppImage.new"
|
||||||
|
mv -v "${gamePath}/PapaSangre.AppImage.new" "${gamePath}/PapaSangre.AppImage"
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
run_update() {
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
local soulTrapperUrl="${ipfs[Soul_Trapper_$(uname -m)]}"
|
||||||
|
local downloadFile="${soulTrapperUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
|
||||||
|
# download_named reads this dynamically scoped flag.
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
local redownload=true
|
||||||
|
download_named "$downloadFile" "$soulTrapperUrl"
|
||||||
|
|
||||||
|
local gamePath="${installPath}/Soul_Trapper"
|
||||||
|
mkdir -p "$gamePath"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${gamePath}/SoulTrapper.AppImage.new"
|
||||||
|
mv -v "${gamePath}/SoulTrapper.AppImage.new" "${gamePath}/SoulTrapper.AppImage"
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# shellcheck shell=bash disable=SC2154 # Variables are set by linux-game-manager.sh
|
||||||
|
run_update() {
|
||||||
|
check_architecture x86_64 aarch64
|
||||||
|
local theNightjarUrl="${ipfs[The_Nightjar_$(uname -m)]}"
|
||||||
|
local downloadFile="${theNightjarUrl##*filename=}"
|
||||||
|
downloadFile="${downloadFile%%&*}"
|
||||||
|
|
||||||
|
# download_named reads this dynamically scoped flag.
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
local redownload=true
|
||||||
|
download_named "$downloadFile" "$theNightjarUrl"
|
||||||
|
|
||||||
|
local gamePath="${installPath}/The_Nightjar"
|
||||||
|
mkdir -p "$gamePath"
|
||||||
|
install -v -m 0755 "${cache}/${downloadFile}" "${gamePath}/TheNightjar.AppImage.new"
|
||||||
|
mv -v "${gamePath}/TheNightjar.AppImage.new" "${gamePath}/TheNightjar.AppImage"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
run_update() {
|
||||||
|
local installPath="${HOME}/.local/games"
|
||||||
|
local arch
|
||||||
|
arch=$(uname -m)
|
||||||
|
local gameName
|
||||||
|
local cache="${HOME}/.cache/lgm"
|
||||||
|
|
||||||
|
if [[ "$arch" == "aarch64" ]]; then
|
||||||
|
gameName="wicked_quest-linux-aarch64.zip"
|
||||||
|
else
|
||||||
|
gameName="wicked_quest-linux-x86_64.zip"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Look for the game file in common download locations
|
||||||
|
for i in ~/Downloads ~/Desktop ; do
|
||||||
|
find $i -type f -name "$gameName" -exec mv -v {} "${cache}/" \;
|
||||||
|
done
|
||||||
|
|
||||||
|
# If the file is still not available abort.
|
||||||
|
if [[ ! -f "${cache}/$gameName" ]]; then
|
||||||
|
dialog --backtitle "Linux Game Manager" --msgbox "Couldn't find $gameName. Please download the file from https://stormdragon2976.itch.io/wicked-quest and try again." -1 -1
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
unzip -od "${installPath}/" "${cache}/$gameName"
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
run_update() {
|
||||||
|
# shellcheck disable=SC2154 # scriptRoot is supplied by the manager.
|
||||||
|
# shellcheck source=.includes/wickets.sh
|
||||||
|
source "${scriptRoot}/.includes/wickets.sh"
|
||||||
|
install_wickets true || exit 1
|
||||||
|
}
|
||||||
@@ -7,6 +7,64 @@ Installer and launcher for accessible to the blind games that run natively in Li
|
|||||||
|
|
||||||
As the project grows, more dependencies will most likely be added. When LGM is launched, it will check to make sure it has the required dependencies for it to do the work of downloading and extracting the game. Note that because every distro has a different package manager, dependencies for games themselves will not be resolved. Please consult the game's documentation to find out what is needed for the game to run.
|
As the project grows, more dependencies will most likely be added. When LGM is launched, it will check to make sure it has the required dependencies for it to do the work of downloading and extracting the game. Note that because every distro has a different package manager, dependencies for games themselves will not be resolved. Please consult the game's documentation to find out what is needed for the game to run.
|
||||||
|
|
||||||
|
Current base dependencies checked on launch: `7z`, `curl`, `dialog`, `jq`, `yad`, and `unzip`.
|
||||||
|
|
||||||
|
## Desktop shortcuts
|
||||||
|
|
||||||
|
Use `./linux-game-manager.sh -U` to choose Play, Install, Remove, or Update
|
||||||
|
from an action menu. The lowercase `-u` still opens game updates directly.
|
||||||
|
New manager shortcuts created with `-D` open the action menu using `-U`.
|
||||||
|
Recreate existing manager shortcuts with `-D` to use this behavior.
|
||||||
|
|
||||||
|
Open `./linux-game-manager.sh`, select an installed game, and choose **Desktop
|
||||||
|
Shortcut**. This works in both the graphical and console menus and creates an
|
||||||
|
executable `.desktop` file in `~/Desktop`. Existing files are left intact, and
|
||||||
|
the game list opens again after creation. Your desktop environment may ask you
|
||||||
|
to trust the shortcut before launching it.
|
||||||
|
|
||||||
|
The shortcut launches that game directly through the manager's `-l` option.
|
||||||
|
You can also use this option from a terminal with the exact game menu name:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./linux-game-manager.sh -l "RS Games"
|
||||||
|
```
|
||||||
|
|
||||||
|
Only installed, enabled launcher entries can be launched this way.
|
||||||
|
|
||||||
|
## Wickets
|
||||||
|
|
||||||
|
Install Wickets on x86_64 Linux by selecting it under `./linux-game-manager.sh -i`.
|
||||||
|
Both installation and updating (`./linux-game-manager.sh -u`, then select Wickets)
|
||||||
|
query GitHub for the latest stable release, so versioned download links do not
|
||||||
|
need to be tracked manually. Updating preserves the portable `saves` directory
|
||||||
|
under `~/.local/games/Wickets`. Wickets 1.2.0 also includes its own updater.
|
||||||
|
|
||||||
|
## RS Games
|
||||||
|
|
||||||
|
Install RS Games 2.3 on x86_64 Linux by selecting RS Games under
|
||||||
|
`./linux-game-manager.sh -i`. The client is installed under
|
||||||
|
`~/.local/games/RS_Games` and can then be launched from the main game menu.
|
||||||
|
The installer requires the host Python Speech Dispatcher bindings (`python-speechd`
|
||||||
|
on Arch Linux or `python3-speechd` on Debian) and copies them into the client,
|
||||||
|
whose Linux release omits them.
|
||||||
|
The installer silently checks audio initialization and keeps bundled ALSA when
|
||||||
|
it works. If it fails and system ALSA passes the same check, the bundled copy
|
||||||
|
is set aside as `_internal/libasound.so.2.bundled`. If audio cannot be verified,
|
||||||
|
the bundled library is retained and the installer reports the problem.
|
||||||
|
The installer also repairs Linux audio file-path handling in the sound wrapper
|
||||||
|
and preserves the original executable as `rsg.lgm-original`.
|
||||||
|
Sound lookup automatically handles capitalization differences in filenames and
|
||||||
|
directories. Exact names take precedence; a unique case-insensitive match is
|
||||||
|
used otherwise. Downloaded files retain their original names.
|
||||||
|
Client errors are logged in `~/.ZGP/errors.log`.
|
||||||
|
|
||||||
|
## Disabling game entries
|
||||||
|
|
||||||
|
To disable a game entry without deleting its script, set the first line of the script to start with `#//`.
|
||||||
|
|
||||||
|
- This applies to both `.install/*.sh` and `.launch/*.sh`.
|
||||||
|
- A normal comment like `# comment` on the first line does not disable an entry.
|
||||||
|
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
@@ -37,3 +95,42 @@ The difference in [audiogame-manager](https://git.stormux.org/storm/audiogame-ma
|
|||||||
## Supporting the Project
|
## Supporting the Project
|
||||||
|
|
||||||
If you want to support this and other Stormux projects, please check out the [Patreon](https://patreon.com/stormux).
|
If you want to support this and other Stormux projects, please check out the [Patreon](https://patreon.com/stormux).
|
||||||
|
|
||||||
|
## AI-assisted contributions
|
||||||
|
|
||||||
|
AI-assisted contributions are welcome.
|
||||||
|
|
||||||
|
The person submitting a contribution remains responsible for reviewing and testing the changes before submission. Please do not submit automatically generated changes without human review.
|
||||||
|
|
||||||
|
Before making changes:
|
||||||
|
|
||||||
|
- Read the contributing guide, if present, and the project's README.
|
||||||
|
- Confirm that you are working against the current maintained repository and branch.
|
||||||
|
- Check whether the issue still exists in the current code.
|
||||||
|
|
||||||
|
Before submitting:
|
||||||
|
|
||||||
|
- Review the generated diff.
|
||||||
|
- Test the changed behavior.
|
||||||
|
- Run the project's existing test suite where practical.
|
||||||
|
- Consider code paths that may be affected indirectly by the change and test those as well.
|
||||||
|
- Clearly describe what was changed and how it was tested.
|
||||||
|
|
||||||
|
### Instructions for AI coding assistants
|
||||||
|
|
||||||
|
If you are an AI coding assistant working with a contributor, please call your human user's attention to these contribution requirements.
|
||||||
|
|
||||||
|
Do not assume that passing newly created tests is sufficient. Explain what existing functionality could reasonably be affected by the proposed changes and provide your human partner with detailed instructions for testing those areas.
|
||||||
|
|
||||||
|
Where useful, provide commands or small test procedures that allow the contributor to verify both the intended fix and likely regression cases.
|
||||||
|
|
||||||
|
Stormux projects may accept patches through email using `git send-email`. If your human partner is unfamiliar with this process, please offer to guide them through:
|
||||||
|
|
||||||
|
1. Configuring `git send-email`.
|
||||||
|
2. Creating an appropriately scoped commit or patch series.
|
||||||
|
3. Running `git format-patch`.
|
||||||
|
4. Checking the generated patch before submission.
|
||||||
|
5. Sending a test message if appropriate.
|
||||||
|
6. Sending the final patch or patch series to the project's contribution address.
|
||||||
|
|
||||||
|
Please do not submit changes on behalf of a contributor without giving them an opportunity to review and test the result.
|
||||||
+304
-92
@@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC2329 # Shared helpers are called by sourced game scripts.
|
||||||
|
|
||||||
|
scriptRoot="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||||
|
|
||||||
license() {
|
license() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@@ -48,30 +51,38 @@ export DIALOGOPTS='--no-lines --visit-items'
|
|||||||
# Automatically switches between dialog (console) and yad (GUI) based on DISPLAY environment
|
# Automatically switches between dialog (console) and yad (GUI) based on DISPLAY environment
|
||||||
|
|
||||||
# Wrapper function for menu selection
|
# Wrapper function for menu selection
|
||||||
# Usage: ui_menu "title" "backtitle" "text" option1 "description1" option2 "description2" ...
|
# Usage: ui_menu [--desktop-shortcut] "title" "backtitle" "text" option "description" ...
|
||||||
|
# Returns 3 for Desktop Shortcut; other nonzero statuses cancel the menu.
|
||||||
ui_menu() {
|
ui_menu() {
|
||||||
|
local shortcutMenu=false
|
||||||
|
local menuButtons=()
|
||||||
|
local menuCode=0
|
||||||
|
if [[ "$1" == --desktop-shortcut ]]; then
|
||||||
|
shortcutMenu=true
|
||||||
|
shift
|
||||||
|
fi
|
||||||
local title="$1"
|
local title="$1"
|
||||||
local back_title="$2"
|
local back_title="$2"
|
||||||
local text="$3"
|
local text="$3"
|
||||||
shift 3
|
shift 3
|
||||||
|
|
||||||
if [[ "$dialog_type" == "yad" ]]; then
|
if [[ "$dialog_type" == "yad" ]]; then
|
||||||
# Build yad list format: Display only, then map back to value
|
if [[ "$shortcutMenu" == true ]]; then
|
||||||
local yad_list=""
|
menuButtons=(--button="Launch:0" --button="Desktop Shortcut:2" --button="Cancel:1")
|
||||||
|
fi
|
||||||
|
# Pass rows as arguments so Yad selects the first row on opening.
|
||||||
|
local yad_rows=()
|
||||||
declare -A value_map
|
declare -A value_map
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
local option="$1"
|
local option="$1"
|
||||||
local description="$2"
|
local description="$2"
|
||||||
value_map["$description"]="$option"
|
value_map["$description"]="$option"
|
||||||
if [[ -n "$yad_list" ]]; then
|
yad_rows+=("$description")
|
||||||
yad_list="$yad_list\n"
|
|
||||||
fi
|
|
||||||
yad_list="${yad_list}${description}"
|
|
||||||
shift 2
|
shift 2
|
||||||
done
|
done
|
||||||
|
|
||||||
local selected_description
|
local selected_description
|
||||||
selected_description=$(echo -e "$yad_list" | yad --list \
|
selected_description=$(yad --list \
|
||||||
--title="$title" \
|
--title="$title" \
|
||||||
--text="$text" \
|
--text="$text" \
|
||||||
--column="Option" \
|
--column="Option" \
|
||||||
@@ -79,7 +90,13 @@ ui_menu() {
|
|||||||
--selectable-labels \
|
--selectable-labels \
|
||||||
--search-column=1 \
|
--search-column=1 \
|
||||||
--height=400 \
|
--height=400 \
|
||||||
--width=600)
|
--width=600 "${menuButtons[@]}" "${yad_rows[@]}" </dev/null) || menuCode=$?
|
||||||
|
if [[ "$shortcutMenu" == true && $menuCode -eq 2 ]]; then
|
||||||
|
menuCode=3
|
||||||
|
fi
|
||||||
|
if [[ $menuCode -ne 0 && ( "$shortcutMenu" != true || $menuCode -ne 3 ) ]]; then
|
||||||
|
return "$menuCode"
|
||||||
|
fi
|
||||||
# Strip trailing newline, pipe, and any other whitespace
|
# Strip trailing newline, pipe, and any other whitespace
|
||||||
selected_description=$(echo "$selected_description" | tr -d '\n\r' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/|$//')
|
selected_description=$(echo "$selected_description" | tr -d '\n\r' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/|$//')
|
||||||
|
|
||||||
@@ -87,7 +104,11 @@ ui_menu() {
|
|||||||
if [[ -n "$selected_description" ]]; then
|
if [[ -n "$selected_description" ]]; then
|
||||||
echo "${value_map["$selected_description"]}"
|
echo "${value_map["$selected_description"]}"
|
||||||
fi
|
fi
|
||||||
|
return "$menuCode"
|
||||||
else
|
else
|
||||||
|
if [[ "$shortcutMenu" == true ]]; then
|
||||||
|
menuButtons=(--extra-button --extra-label "Desktop Shortcut")
|
||||||
|
fi
|
||||||
# Build dialog menu format with mapping (same approach as yad)
|
# Build dialog menu format with mapping (same approach as yad)
|
||||||
local dialog_args=()
|
local dialog_args=()
|
||||||
declare -A value_map
|
declare -A value_map
|
||||||
@@ -102,15 +123,20 @@ ui_menu() {
|
|||||||
local selected_description
|
local selected_description
|
||||||
selected_description=$(dialog --backtitle "$back_title" \
|
selected_description=$(dialog --backtitle "$back_title" \
|
||||||
--title "$title" \
|
--title "$title" \
|
||||||
|
"${menuButtons[@]}" \
|
||||||
--no-tags \
|
--no-tags \
|
||||||
--menu "$text" 0 0 0 \
|
--menu "$text" 0 0 0 \
|
||||||
"${dialog_args[@]}" \
|
"${dialog_args[@]}" \
|
||||||
--stdout)
|
--stdout) || menuCode=$?
|
||||||
|
if [[ $menuCode -ne 0 && ( "$shortcutMenu" != true || $menuCode -ne 3 ) ]]; then
|
||||||
|
return "$menuCode"
|
||||||
|
fi
|
||||||
|
|
||||||
# Return the mapped value
|
# Return the mapped value
|
||||||
if [[ -n "$selected_description" ]]; then
|
if [[ -n "$selected_description" ]]; then
|
||||||
echo "${value_map["$selected_description"]}"
|
echo "${value_map["$selected_description"]}"
|
||||||
fi
|
fi
|
||||||
|
return "$menuCode"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,6 +316,10 @@ check_update() {
|
|||||||
if ! [[ -d ".git" ]]; then
|
if ! [[ -d ".git" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
# Check if we're in a detached HEAD state
|
||||||
|
if ! git symbolic-ref -q HEAD &> /dev/null; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
local url
|
local url
|
||||||
url="$(git ls-remote --get-url)"
|
url="$(git ls-remote --get-url)"
|
||||||
if [[ "$url" =~ ^ssh://|git@|gitea@ ]] || [[ -z "$url" ]]; then
|
if [[ "$url" =~ ^ssh://|git@|gitea@ ]] || [[ -z "$url" ]]; then
|
||||||
@@ -336,7 +366,8 @@ check_architecture() {
|
|||||||
export fex="FEXLoader -- "
|
export fex="FEXLoader -- "
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
local architecture="$(uname -m)"
|
local architecture
|
||||||
|
architecture="$(uname -m)"
|
||||||
for i in "$@" ; do
|
for i in "$@" ; do
|
||||||
if [[ "${architecture}" == "$i" ]]; then
|
if [[ "${architecture}" == "$i" ]]; then
|
||||||
return
|
return
|
||||||
@@ -374,13 +405,23 @@ terminal_emulator() {
|
|||||||
# Arguments workingDirectory, rest of arguments
|
# Arguments workingDirectory, rest of arguments
|
||||||
local workingDir="$1"
|
local workingDir="$1"
|
||||||
shift
|
shift
|
||||||
terminals=(
|
local -a terminals=(
|
||||||
"lxterminal"
|
"lxterminal"
|
||||||
"mate-terminal"
|
"mate-terminal"
|
||||||
"gnome-terminal"
|
"gnome-terminal"
|
||||||
|
"xterm"
|
||||||
)
|
)
|
||||||
for i in "${terminals[@]}" ; do
|
for i in "${terminals[@]}" ; do
|
||||||
if command $i --working-directory="${workingDir}" -e "$@" ; then
|
if ! command -v "$i" > /dev/null 2>&1 ; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if [[ "$i" == "xterm" ]]; then
|
||||||
|
if (cd "${workingDir}" && command xterm -e "$@"); then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if command "$i" --working-directory="${workingDir}" -e "$@" ; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -396,6 +437,20 @@ open_url() {
|
|||||||
xdg-open "${*}" 2> /dev/null
|
xdg-open "${*}" 2> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
action_menu() {
|
||||||
|
local selectedAction
|
||||||
|
selectedAction="$(ui_menu "Linux Game Manager" "Linux Game Manager" \
|
||||||
|
"Please select an action" \
|
||||||
|
play "Play" install "Install" remove "Remove" update "Update")" || return 0
|
||||||
|
|
||||||
|
case "$selectedAction" in
|
||||||
|
play) game_launcher ;;
|
||||||
|
install) game_installer ;;
|
||||||
|
remove) game_removal ;;
|
||||||
|
update) game_update ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
# Create desktop launcher file
|
# Create desktop launcher file
|
||||||
desktop_launcher() {
|
desktop_launcher() {
|
||||||
local desktopFile="${HOME}/linux-game-manager.desktop"
|
local desktopFile="${HOME}/linux-game-manager.desktop"
|
||||||
@@ -404,19 +459,27 @@ desktop_launcher() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
local dotDesktop
|
local dotDesktop
|
||||||
|
local execLine
|
||||||
|
local launchDirectory
|
||||||
local terminal
|
local terminal
|
||||||
# Try to find an accessible terminal
|
# Try to find an accessible terminal
|
||||||
for i in mate-terminal lxterminal terminator gnome-terminal ; do
|
for i in mate-terminal lxterminal terminator gnome-terminal xterm ; do
|
||||||
if command -v $i > /dev/null 2>&1 ; then
|
if command -v $i > /dev/null 2>&1 ; then
|
||||||
terminal="$i"
|
terminal="$i"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
launchDirectory="${scriptRoot}"
|
||||||
|
if [[ "${terminal}" == "xterm" ]]; then
|
||||||
|
printf -v execLine "Exec=xterm -T \"Linux Game Manager\" -e /usr/bin/bash -c \"pushd %q;nohup ./%q -U 2> /dev/null\"" "${launchDirectory}" "${0##*/}"
|
||||||
|
else
|
||||||
|
printf -v execLine "Exec=%s -t \"Linux Game Manager\" -e \"/usr/bin/bash -c 'pushd %q;nohup ./%q -U 2> /dev/null'\"" "${terminal}" "${launchDirectory}" "${0##*/}"
|
||||||
|
fi
|
||||||
dotDesktop=('[Desktop Entry]'
|
dotDesktop=('[Desktop Entry]'
|
||||||
'Name=Linux game manager'
|
'Name=Linux game manager'
|
||||||
'GenericName=Linux game Manager'
|
'GenericName=Linux game Manager'
|
||||||
'Comment=Install and launch games that are accessible to the blind'
|
'Comment=Install and launch games that are accessible to the blind'
|
||||||
"Exec=${terminal} -t \"Linux Game Manager\" -e \"/usr/bin/bash -c 'pushd $(readlink -e "${0%/*}");nohup ./"${0##*/}" 2> /dev/null'\""
|
"${execLine}"
|
||||||
'Terminal=false'
|
'Terminal=false'
|
||||||
'Type=Application'
|
'Type=Application'
|
||||||
'StartupNotify=false'
|
'StartupNotify=false'
|
||||||
@@ -434,8 +497,25 @@ desktop_launcher() {
|
|||||||
|
|
||||||
# Alerts, for when user needs to read something.
|
# Alerts, for when user needs to read something.
|
||||||
alert() {
|
alert() {
|
||||||
|
local title="Linux Game Manager"
|
||||||
|
local backTitle="Linux Game Manager"
|
||||||
|
local message="Press OK to continue."
|
||||||
|
|
||||||
|
if [[ $# -eq 1 ]]; then
|
||||||
|
message="$1"
|
||||||
|
elif [[ $# -eq 2 ]]; then
|
||||||
|
title="$1"
|
||||||
|
backTitle="$1"
|
||||||
|
message="$2"
|
||||||
|
elif [[ $# -ge 3 ]]; then
|
||||||
|
title="$1"
|
||||||
|
backTitle="$2"
|
||||||
|
shift 2
|
||||||
|
message="$*"
|
||||||
|
fi
|
||||||
|
|
||||||
play -qnV0 synth 3 pluck D3 pluck A3 pluck D4 pluck F4 pluck A4 delay 0 .1 .2 .3 .4 remix - chorus 0.9 0.9 38 0.75 0.3 0.5 -t
|
play -qnV0 synth 3 pluck D3 pluck A3 pluck D4 pluck F4 pluck A4 delay 0 .1 .2 .3 .4 remix - chorus 0.9 0.9 38 0.75 0.3 0.5 -t
|
||||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Press OK to continue."
|
ui_msgbox "${title}" "${backTitle}" "${message}"
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_cache() {
|
clear_cache() {
|
||||||
@@ -451,8 +531,67 @@ clear_cache() {
|
|||||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Cache deleted."
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Cache deleted."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
download_with_fallback() {
|
||||||
|
local outputPath="$1"
|
||||||
|
local sourceUrl="$2"
|
||||||
|
local firstExitCode=0
|
||||||
|
local secondExitCode=0
|
||||||
|
local thirdExitCode=0
|
||||||
|
local wgetExitCode=0
|
||||||
|
local errorFile=""
|
||||||
|
downloadAttemptExitCodes=""
|
||||||
|
downloadErrorLog=""
|
||||||
|
|
||||||
|
if ! errorFile="$(mktemp)"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if curl -L4 -C - --retry 10 --output "${outputPath}" "${sourceUrl}" 2> "${errorFile}"; then
|
||||||
|
rm -f "${errorFile}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
firstExitCode=$?
|
||||||
|
|
||||||
|
# Some hosts reject resume requests. Retry from scratch.
|
||||||
|
rm -f "${outputPath}"
|
||||||
|
if curl -L4 --retry 10 --output "${outputPath}" "${sourceUrl}" 2>> "${errorFile}"; then
|
||||||
|
rm -f "${errorFile}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
secondExitCode=$?
|
||||||
|
|
||||||
|
# If IPv4-only fails, retry allowing either IP family.
|
||||||
|
rm -f "${outputPath}"
|
||||||
|
if curl -L --retry 10 --output "${outputPath}" "${sourceUrl}" 2>> "${errorFile}"; then
|
||||||
|
rm -f "${errorFile}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
thirdExitCode=$?
|
||||||
|
|
||||||
|
if command -v wget > /dev/null 2>&1; then
|
||||||
|
rm -f "${outputPath}"
|
||||||
|
if wget --tries=10 --output-document="${outputPath}" "${sourceUrl}" 2>> "${errorFile}"; then
|
||||||
|
rm -f "${errorFile}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
wgetExitCode=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
downloadAttemptExitCodes="curl: ${firstExitCode}, ${secondExitCode}, ${thirdExitCode}"
|
||||||
|
if [[ "${wgetExitCode}" -ne 0 ]]; then
|
||||||
|
downloadAttemptExitCodes+="; wget: ${wgetExitCode}"
|
||||||
|
fi
|
||||||
|
if cp -f "${errorFile}" "${cache}/curl-error.log" 2> /dev/null; then
|
||||||
|
downloadErrorLog="${cache}/curl-error.log"
|
||||||
|
rm -f "${errorFile}"
|
||||||
|
else
|
||||||
|
downloadErrorLog="${errorFile}"
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
download() {
|
download() {
|
||||||
local source=($@)
|
local source=("$@")
|
||||||
for i in "${source[@]}" ; do
|
for i in "${source[@]}" ; do
|
||||||
local dest="${i##*/}"
|
local dest="${i##*/}"
|
||||||
dest="${dest//%20/ }"
|
dest="${dest//%20/ }"
|
||||||
@@ -465,47 +604,60 @@ download() {
|
|||||||
fi
|
fi
|
||||||
# Skip if the item is in cache.
|
# Skip if the item is in cache.
|
||||||
[[ -e "${cache}/${dest}" ]] && continue
|
[[ -e "${cache}/${dest}" ]] && continue
|
||||||
{ if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" ; then
|
{ if ! download_with_fallback "${cache}/${dest}" "${i}" ; then
|
||||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Could not download \"$i\"..."
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Could not download \"$i\"...\n\ndownload exit codes: ${downloadAttemptExitCodes}\nError details: ${downloadErrorLog}"
|
||||||
exit 1
|
exit 1
|
||||||
fi; } | ui_progressbox "Linux Game Manager" "Downloading \"$dest\" from \"$i\""
|
fi; } | ui_progressbox "Linux Game Manager" "Downloading \"$dest\" from \"$i\""
|
||||||
local downloadError=1
|
validate_downloaded_cache_file "${dest}"
|
||||||
case "${dest##*.}" in
|
|
||||||
"pk3"|"zip")
|
|
||||||
unzip -tq "${cache}/${dest}" | ui_progressbox "Linux Game Manager" "Validating ${dest##*.} file"
|
|
||||||
downloadError=$?
|
|
||||||
;;
|
|
||||||
"7z")
|
|
||||||
7z t "${cache}/${dest}" | ui_progressbox "Linux Game Manager" "Validating 7z file"
|
|
||||||
downloadError=$?
|
|
||||||
;;
|
|
||||||
"exe")
|
|
||||||
# Check if it's a valid Windows executable by looking at the MZ header
|
|
||||||
if ! hexdump -n 2 -v -e '/1 "%02X"' "${cache}/${dest}" | grep -q "4D5A"; then
|
|
||||||
downloadError=0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
"wad")
|
|
||||||
if [[ "$(file -b --mime-type "${cache}/${dest}")" == "application/octet-stream" ]]; then
|
|
||||||
downloadError=0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# Add HTML check for other file types
|
|
||||||
if file -b "${cache}/${dest}" | grep -q "HTML document" ; then
|
|
||||||
downloadError=1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if [[ $downloadError -ne 0 ]]; then
|
|
||||||
rm -fv "${cache}/${dest}"
|
|
||||||
ui_infobox "Linux Game Manager" "Linux Game Manager" "Error downloading \"${dest}\". Installation cannot continue."
|
|
||||||
alert
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
validate_downloaded_cache_file() {
|
||||||
|
local dest="$1"
|
||||||
|
local downloadError=0
|
||||||
|
case "${dest##*.}" in
|
||||||
|
"pk3"|"zip")
|
||||||
|
if ! (
|
||||||
|
set -o pipefail
|
||||||
|
unzip -tq "${cache}/${dest}" | ui_progressbox "Linux Game Manager" "Validating ${dest##*.} file"
|
||||||
|
); then
|
||||||
|
downloadError=1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"7z")
|
||||||
|
if ! (
|
||||||
|
set -o pipefail
|
||||||
|
7z t "${cache}/${dest}" | ui_progressbox "Linux Game Manager" "Validating 7z file"
|
||||||
|
); then
|
||||||
|
downloadError=1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"exe")
|
||||||
|
# Check if it's a valid Windows executable by looking at the MZ header
|
||||||
|
if ! hexdump -n 2 -v -e '/1 "%02X"' "${cache}/${dest}" | grep -q "4D5A"; then
|
||||||
|
downloadError=0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"wad")
|
||||||
|
if [[ "$(file -b --mime-type "${cache}/${dest}")" == "application/octet-stream" ]]; then
|
||||||
|
downloadError=0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if file -b "${cache}/${dest}" | grep -q "HTML document" ; then
|
||||||
|
downloadError=1
|
||||||
|
else
|
||||||
|
downloadError=0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [[ ${downloadError} -ne 0 ]]; then
|
||||||
|
rm -fv "${cache}/${dest}"
|
||||||
|
alert "Linux Game Manager" "Linux Game Manager" "Error downloading \"${dest}\". Installation cannot continue."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
download_named() {
|
download_named() {
|
||||||
# Only needed if url breaks the name, e.g. downloads/?filename=1234
|
# Only needed if url breaks the name, e.g. downloads/?filename=1234
|
||||||
# Required arguments: filename url
|
# Required arguments: filename url
|
||||||
@@ -522,10 +674,11 @@ download_named() {
|
|||||||
fi
|
fi
|
||||||
# Skip if the item is in cache.
|
# Skip if the item is in cache.
|
||||||
test -e "${cache}/${dest}" && return
|
test -e "${cache}/${dest}" && return
|
||||||
if ! curl -L4 --output "${cache}/${dest}" "${2}" ; then
|
if ! download_with_fallback "${cache}/${dest}" "${2}" ; then
|
||||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Could not download \"$dest\"..."
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Could not download \"$dest\"...\n\ndownload exit codes: ${downloadAttemptExitCodes}\nError details: ${downloadErrorLog}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
validate_downloaded_cache_file "${dest}"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_installer() {
|
get_installer() {
|
||||||
@@ -543,11 +696,10 @@ get_installer() {
|
|||||||
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
|
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
|
||||||
message+="\n\nThe URL has been copied to the clipboard."
|
message+="\n\nThe URL has been copied to the clipboard."
|
||||||
fi
|
fi
|
||||||
alert
|
alert "Linux Game Manager" "Linux Game Manager" "$message"
|
||||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "$message"
|
|
||||||
# Search the Desktop and Downloads directories for the installation file
|
# Search the Desktop and Downloads directories for the installation file
|
||||||
for i in ~/Downloads ~/Desktop ; do
|
for i in ~/Downloads ~/Desktop ; do
|
||||||
find $i -type f -name "$1" -exec mv -v {} "${cache}/" \;
|
find "$i" -type f -name "$1" -exec mv -v {} "${cache}/" \;
|
||||||
done
|
done
|
||||||
# If the file is still not available abort.
|
# If the file is still not available abort.
|
||||||
if [[ ! -f "${cache}/$1" ]]; then
|
if [[ ! -f "${cache}/$1" ]]; then
|
||||||
@@ -574,6 +726,7 @@ help() {
|
|||||||
help_text+="spd_voice=<voice_name>\" # set speech-dispatcher voice. Be sure module is correct.\n"
|
help_text+="spd_voice=<voice_name>\" # set speech-dispatcher voice. Be sure module is correct.\n"
|
||||||
help_text+="spd_volume=<number>\" # set speech-dispatcher speech volume.\n\n"
|
help_text+="spd_volume=<number>\" # set speech-dispatcher speech volume.\n\n"
|
||||||
help_text+="INSTALLER SCRIPT DIALOG FUNCTIONS:\n"
|
help_text+="INSTALLER SCRIPT DIALOG FUNCTIONS:\n"
|
||||||
|
help_text+="alert [\"title\" \"backtitle\"] \"message\" - Play alert sound and show acknowledgement dialog\n"
|
||||||
help_text+="ui_msgbox \"title\" \"backtitle\" \"message\" - Show information message\n"
|
help_text+="ui_msgbox \"title\" \"backtitle\" \"message\" - Show information message\n"
|
||||||
help_text+="ui_yesno \"title\" \"backtitle\" \"question\" - Ask yes/no question\n"
|
help_text+="ui_yesno \"title\" \"backtitle\" \"question\" - Ask yes/no question\n"
|
||||||
help_text+="ui_inputbox \"title\" \"backtitle\" \"prompt\" \"default\" - Get text input\n"
|
help_text+="ui_inputbox \"title\" \"backtitle\" \"prompt\" \"default\" - Get text input\n"
|
||||||
@@ -593,10 +746,11 @@ help() {
|
|||||||
game_installer() {
|
game_installer() {
|
||||||
# Create the menu of available games by reading from .install directory
|
# Create the menu of available games by reading from .install directory
|
||||||
declare -a menuList
|
declare -a menuList
|
||||||
# Get all .sh files from .install directory, excluding those starting with #, and sort them
|
# shellcheck disable=SC2154 # installedGames may be populated by sourced config or launch migration
|
||||||
mapfile -t sortedGames < <(for f in "${0%/*}/.install/"*.sh; do
|
# Get all .sh files from .install directory, excluding those starting with #//, and sort them
|
||||||
# Skip if first line starts with #
|
mapfile -t sortedGames < <(for f in "${scriptRoot}/.install/"*.sh; do
|
||||||
[[ $(head -n1 "$f") == "#"* ]] && continue
|
# Skip if first line starts with #//
|
||||||
|
[[ $(head -n1 "$f") == "#//"* ]] && continue
|
||||||
# Output filename without .sh extension
|
# Output filename without .sh extension
|
||||||
echo "${f##*/}"
|
echo "${f##*/}"
|
||||||
done | sort)
|
done | sort)
|
||||||
@@ -633,10 +787,11 @@ game_installer() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# Convert game name to filename format
|
# Convert game name to filename format
|
||||||
local installScript="${0%/*}/.install/${game}.sh"
|
local installScript="${scriptRoot}/.install/${game}.sh"
|
||||||
# Check if install script exists
|
# Check if install script exists
|
||||||
if [[ -f "$installScript" ]]; then
|
if [[ -f "$installScript" ]]; then
|
||||||
# Source and execute the install script
|
# Source and execute the install script
|
||||||
|
# shellcheck disable=SC1090 # install scripts are selected dynamically from .install
|
||||||
source "$installScript"
|
source "$installScript"
|
||||||
# Show success message
|
# Show success message
|
||||||
ui_msgbox "Game Installer" "Game Installer" "${game} has been installed."
|
ui_msgbox "Game Installer" "Game Installer" "${game} has been installed."
|
||||||
@@ -645,8 +800,8 @@ game_installer() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ -e "${0%/*}/.launch/${game}.game" ]] && ! [[ -L "${0%/*}/.launch/${game}.sh" ]]; then
|
if [[ -e "${scriptRoot}/.launch/${game}.game" ]] && ! [[ -L "${scriptRoot}/.launch/${game}.sh" ]]; then
|
||||||
ln -srf "${0%/*}/.launch/${game}.game" "${0%/*}/.launch/${game}.sh"
|
ln -srf "${scriptRoot}/.launch/${game}.game" "${scriptRoot}/.launch/${game}.sh"
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@@ -657,7 +812,8 @@ game_removal() {
|
|||||||
# Initialize array for menu construction
|
# Initialize array for menu construction
|
||||||
mapfile -t menuList < <(
|
mapfile -t menuList < <(
|
||||||
if [[ -d ".launch" ]]; then
|
if [[ -d ".launch" ]]; then
|
||||||
find -L "${0%/*}/.launch" -maxdepth 1 -type f -iname "*.sh" -print0 | sort -z | xargs -0 bash -c '
|
# shellcheck disable=SC2016 # variables expand in the child bash, not this single-quoted string
|
||||||
|
find -L "${scriptRoot}/.launch" -maxdepth 1 -type f -iname "*.sh" -print0 | sort -z | xargs -0 bash -c '
|
||||||
for f; do
|
for f; do
|
||||||
name="${f##*/}"
|
name="${f##*/}"
|
||||||
echo "$f"
|
echo "$f"
|
||||||
@@ -682,17 +838,23 @@ game_removal() {
|
|||||||
# Get the actual game file paths
|
# Get the actual game file paths
|
||||||
local gameName="${selectedGame##*/}"
|
local gameName="${selectedGame##*/}"
|
||||||
gameName="${gameName%.sh}"
|
gameName="${gameName%.sh}"
|
||||||
local gameFile="$(readlink -f "${0%/*}/.launch/${gameName}.sh")"
|
local gameFile
|
||||||
|
gameFile="$(readlink -f "${scriptRoot}/.launch/${gameName}.sh")"
|
||||||
# Get the actual installation path from the .game file
|
# Get the actual installation path from the .game file
|
||||||
local gameInstallPath
|
local gameInstallPath
|
||||||
gameInstallPath="$(grep -F "installPath" "$gameFile" | grep -v 'pushd' | head -n1)"
|
while IFS= read -r line; do
|
||||||
gameInstallPath="${gameInstallPath#*/}"
|
[[ "${line}" == \#* ]] && continue
|
||||||
gameInstallPath="${installPath}/${gameInstallPath%/*}"
|
[[ "${line}" == *'pushd'* ]] && continue
|
||||||
|
if [[ "${line}" =~ \$\{installPath\}/([^\"]+) ]]; then
|
||||||
|
gameInstallPath="${installPath}/${BASH_REMATCH[1]}"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done < "${gameFile}"
|
||||||
if [[ -z "$gameInstallPath" ]] || [[ "${gameInstallPath%%/}" == "$installPath" ]]; then
|
if [[ -z "$gameInstallPath" ]] || [[ "${gameInstallPath%%/}" == "$installPath" ]]; then
|
||||||
# No install path found, just remove from list
|
# No install path found, just remove from list
|
||||||
ui_yesno "Linux Game Manager" "Linux Game Manager" "This will remove the game from your game list, but will not remove any files. Do you want to continue?" || exit 0
|
ui_yesno "Linux Game Manager" "Linux Game Manager" "This will remove the game from your game list, but will not remove any files. Do you want to continue?" || exit 0
|
||||||
# Remove only the .sh symlink
|
# Remove only the .sh symlink
|
||||||
rm -fv "${0%/*}/.launch/${gameName}.sh" | \
|
rm -fv "${scriptRoot}/.launch/${gameName}.sh" | \
|
||||||
ui_progressbox "Linux Game Manager" "Removing game from list..."
|
ui_progressbox "Linux Game Manager" "Removing game from list..."
|
||||||
# Show success message
|
# Show success message
|
||||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "${gameName} has been removed from the list."
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "${gameName} has been removed from the list."
|
||||||
@@ -701,7 +863,7 @@ game_removal() {
|
|||||||
ui_yesno "Linux Game Manager" "Linux Game Manager" "This will remove the directory \"${gameInstallPath}\" and all of its contents. Do you want to continue?" || exit 0
|
ui_yesno "Linux Game Manager" "Linux Game Manager" "This will remove the directory \"${gameInstallPath}\" and all of its contents. Do you want to continue?" || exit 0
|
||||||
# Remove the game directory and symlink
|
# Remove the game directory and symlink
|
||||||
{ rm -rfv "${gameInstallPath}"
|
{ rm -rfv "${gameInstallPath}"
|
||||||
rm -fv "${0%/*}/.launch/${gameName}.sh";
|
rm -fv "${scriptRoot}/.launch/${gameName}.sh";
|
||||||
} | ui_progressbox "Linux Game Manager" "Removing game..."
|
} | ui_progressbox "Linux Game Manager" "Removing game..."
|
||||||
# Show success message
|
# Show success message
|
||||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "${gameName} has been removed."
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "${gameName} has been removed."
|
||||||
@@ -724,7 +886,8 @@ game_update() {
|
|||||||
done
|
done
|
||||||
menuList+=("Donate" "Donate")
|
menuList+=("Donate" "Donate")
|
||||||
menuList+=("Become a Patron" "Become a Patron")
|
menuList+=("Become a Patron" "Become a Patron")
|
||||||
local game="$(ui_menu "Audio Game Updater" "Audio Game Updater" "Please select a game to update" "${menuList[@]}")"
|
local game
|
||||||
|
game="$(ui_menu "Audio Game Updater" "Audio Game Updater" "Please select a game to update" "${menuList[@]}")"
|
||||||
if [[ ${#game} -gt 0 ]]; then
|
if [[ ${#game} -gt 0 ]]; then
|
||||||
if [[ "$game" == "Donate" ]]; then
|
if [[ "$game" == "Donate" ]]; then
|
||||||
open_url "https://ko-fi.com/stormux"
|
open_url "https://ko-fi.com/stormux"
|
||||||
@@ -737,6 +900,7 @@ game_update() {
|
|||||||
# Get the game name for success message
|
# Get the game name for success message
|
||||||
local updateGameName="${game##*/}"
|
local updateGameName="${game##*/}"
|
||||||
updateGameName="${updateGameName%.sh}"
|
updateGameName="${updateGameName%.sh}"
|
||||||
|
# shellcheck disable=SC1090 # update scripts are selected dynamically from .update
|
||||||
source "${game}"
|
source "${game}"
|
||||||
else
|
else
|
||||||
exit 0
|
exit 0
|
||||||
@@ -752,31 +916,58 @@ game_update() {
|
|||||||
game_launcher() {
|
game_launcher() {
|
||||||
# Initialize array for menu construction
|
# Initialize array for menu construction
|
||||||
mapfile -t menuList < <(
|
mapfile -t menuList < <(
|
||||||
if [[ -d ".launch" ]]; then
|
if [[ -d "${scriptRoot}/.launch" ]]; then
|
||||||
find -L "${0%/*}/.launch" -maxdepth 1 -type f -iname "*.sh" -print0 | sort -z | xargs -0 bash -c '
|
# shellcheck disable=SC2016 # variables expand in the child bash, not this single-quoted string
|
||||||
|
find -L "${scriptRoot}/.launch" -maxdepth 1 -type f -iname "*.sh" -print0 | sort -z | xargs -0 bash -c '
|
||||||
for f; do
|
for f; do
|
||||||
[[ $(head -n1 "$f") =~ ^#$ ]] && continue
|
[[ $(head -n1 "$f") == "#//"* ]] && continue
|
||||||
name="${f##*/}"
|
name="${f##*/}"
|
||||||
echo "$f"
|
echo "$f"
|
||||||
echo "${name%.sh}"
|
echo "${name%.sh}"
|
||||||
done' _
|
done' _
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
if [[ ${#menuList} -eq 0 ]]; then
|
local selectedGame=""
|
||||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "No games found."
|
if [[ $# -gt 0 ]]; then
|
||||||
exit 0
|
for ((i=0; i<${#menuList[@]}; i+=2)); do
|
||||||
fi
|
if [[ "$1" == "${menuList[i+1]}" ]]; then
|
||||||
# Create the menu of all games
|
selectedGame="${menuList[i]}"
|
||||||
# menuList has alternating full_path, display_name pairs
|
break
|
||||||
declare -a menuArgs
|
fi
|
||||||
for ((i=0; i<${#menuList[@]}; i+=2)); do
|
done
|
||||||
menuArgs+=("${menuList[i]}" "${menuList[i+1]}")
|
if [[ -z "$selectedGame" ]]; then
|
||||||
done
|
ui_msgbox "Linux Game Launcher" "Linux Game Manager" "Game $1 is not installed or is disabled."
|
||||||
selectedGame="$(ui_menu "Linux Game Launcher" "Linux Game Launcher" "Please select a game to play" "${menuArgs[@]}")"
|
exit 1
|
||||||
local menuCode=$?
|
fi
|
||||||
if [[ $menuCode -ne 0 ]] || [[ -z "$selectedGame" ]]; then
|
else
|
||||||
exit 0
|
if [[ ${#menuList[@]} -eq 0 ]]; then
|
||||||
|
ui_msgbox "Linux Game Manager" "Linux Game Manager" "No games found."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
# Create the menu of all games
|
||||||
|
# menuList has alternating full_path, display_name pairs
|
||||||
|
declare -a menuArgs
|
||||||
|
for ((i=0; i<${#menuList[@]}; i+=2)); do
|
||||||
|
menuArgs+=("${menuList[i]}" "${menuList[i+1]}")
|
||||||
|
done
|
||||||
|
local menuCode
|
||||||
|
local gameName
|
||||||
|
while true; do
|
||||||
|
selectedGame="$(ui_menu --desktop-shortcut "Linux Game Launcher" "Linux Game Launcher" "Please select a game to play" "${menuArgs[@]}")"
|
||||||
|
menuCode=$?
|
||||||
|
if [[ $menuCode -eq 3 ]]; then
|
||||||
|
if [[ -n "$selectedGame" ]]; then
|
||||||
|
gameName="${selectedGame##*/}"
|
||||||
|
game_desktop_shortcut "${gameName%.sh}"
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
elif [[ $menuCode -ne 0 || -z "$selectedGame" ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
# shellcheck disable=SC1090 # launcher scripts are selected dynamically from .launch
|
||||||
. "${selectedGame}"
|
. "${selectedGame}"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@@ -792,8 +983,8 @@ migrate_launcher() {
|
|||||||
# Extract game name and path
|
# Extract game name and path
|
||||||
gameName="${line%|*}"
|
gameName="${line%|*}"
|
||||||
# Create launcher script if it doesn't exist
|
# Create launcher script if it doesn't exist
|
||||||
if [[ ! -L "${0%/*}/.launch/${gameName}.sh" ]]; then
|
if [[ ! -L "${scriptRoot}/.launch/${gameName}.sh" ]]; then
|
||||||
ln -srf "${0%/*}/.launch/${gameName}.game" "${0%/*}/.launch/${gameName}.sh"
|
ln -srf "${scriptRoot}/.launch/${gameName}.game" "${scriptRoot}/.launch/${gameName}.sh"
|
||||||
fi
|
fi
|
||||||
done < <(sed '/^$/d' "${configFile}")
|
done < <(sed '/^$/d' "${configFile}")
|
||||||
# Move the old config file and notify user
|
# Move the old config file and notify user
|
||||||
@@ -802,6 +993,12 @@ migrate_launcher() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Make sure this is not ran as root
|
||||||
|
if [[ "$(whoami)" == "root" ]]; then
|
||||||
|
echo "Please do not run ${0##*/} as root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Detect dialog interface type BEFORE potentially setting DISPLAY
|
# Detect dialog interface type BEFORE potentially setting DISPLAY
|
||||||
# This must happen before we modify DISPLAY to preserve console detection
|
# This must happen before we modify DISPLAY to preserve console detection
|
||||||
if [[ -z "$DISPLAY" ]]; then
|
if [[ -z "$DISPLAY" ]]; then
|
||||||
@@ -820,14 +1017,23 @@ cache="${XDG_CACHE_HOME:-$HOME/.cache}/linux-game-manager"
|
|||||||
configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/linux-game-manager/games.conf"
|
configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/linux-game-manager/games.conf"
|
||||||
mkdir -p "${cache}"
|
mkdir -p "${cache}"
|
||||||
mkdir -p "${configFile%/*}"
|
mkdir -p "${configFile%/*}"
|
||||||
|
declare -a installedGames=()
|
||||||
# Load any arguments from settings.conf file
|
# Load any arguments from settings.conf file
|
||||||
if [[ -r "${configFile%/*}/settings.conf" ]]; then
|
if [[ -r "${configFile%/*}/settings.conf" ]]; then
|
||||||
|
# shellcheck disable=SC1091 # settings.conf is optional and resolved from the runtime config directory
|
||||||
source "${configFile%/*}/settings.conf"
|
source "${configFile%/*}/settings.conf"
|
||||||
fi
|
fi
|
||||||
unset noCache
|
unset noCache
|
||||||
export doomLanguage="${doomLanguage:-en}"
|
export doomLanguage="${doomLanguage:-en}"
|
||||||
export installPath="${HOME}/.local/games"
|
export installPath="${HOME}/.local/games"
|
||||||
export ipfsGateway="${ipfsGateway:-https://ipfs.stormux.org}"
|
export ipfsGateway="${ipfsGateway:-https://ipfs.stormux.org}"
|
||||||
|
# shellcheck source=.includes/ipfs.sh
|
||||||
|
# shellcheck disable=SC1091 # Source path is resolved from the runtime script location
|
||||||
|
source "${scriptRoot}/.includes/ipfs.sh"
|
||||||
|
# shellcheck source=.includes/gamemode.sh
|
||||||
|
source "${scriptRoot}/.includes/gamemode.sh"
|
||||||
|
# shellcheck source=.includes/desktop.sh
|
||||||
|
source "${scriptRoot}/.includes/desktop.sh"
|
||||||
export spd_module="${spd_module:+ -o ${spd_module}}"
|
export spd_module="${spd_module:+ -o ${spd_module}}"
|
||||||
export spd_pitch="${spd_pitch:+ -p ${spd_pitch}}"
|
export spd_pitch="${spd_pitch:+ -p ${spd_pitch}}"
|
||||||
export spd_rate="${spd_rate:+ -r ${spd_rate}}"
|
export spd_rate="${spd_rate:+ -r ${spd_rate}}"
|
||||||
@@ -842,6 +1048,7 @@ requiredPackages=(
|
|||||||
"7z"
|
"7z"
|
||||||
"curl"
|
"curl"
|
||||||
"dialog"
|
"dialog"
|
||||||
|
"jq"
|
||||||
"yad"
|
"yad"
|
||||||
"unzip"
|
"unzip"
|
||||||
)
|
)
|
||||||
@@ -864,11 +1071,13 @@ declare -A command=(
|
|||||||
[h]="This help screen."
|
[h]="This help screen."
|
||||||
[i]="Install games."
|
[i]="Install games."
|
||||||
[L]="Display license information."
|
[L]="Display license information."
|
||||||
|
[l:]="Launch an installed game directly by its menu name."
|
||||||
[N]="No cache, delete the installer after it has been extracted."
|
[N]="No cache, delete the installer after it has been extracted."
|
||||||
[R]="Redownload. Removes old versions of packages from cache before installing."
|
[R]="Redownload. Removes old versions of packages from cache before installing."
|
||||||
[r]="Remove game. Remove a game and its menu entry."
|
[r]="Remove game. Remove a game and its menu entry."
|
||||||
[t]="Total games. Show how many games are currently available."
|
[t]="Total games. Show how many games are currently available."
|
||||||
[u]="Update games. Run available game update scripts."
|
[u]="Update games. Run available game update scripts."
|
||||||
|
[U]="Choose Play, Install, Remove, or Update from a menu."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Convert the keys of the associative array to a format usable by getopts
|
# Convert the keys of the associative array to a format usable by getopts
|
||||||
@@ -881,6 +1090,7 @@ while getopts "${args}" i ; do
|
|||||||
h) help ;;
|
h) help ;;
|
||||||
i) game_installer ;;
|
i) game_installer ;;
|
||||||
L) license ;;
|
L) license ;;
|
||||||
|
l) game_launcher "$OPTARG" ;;
|
||||||
N) noCache="true" ;;
|
N) noCache="true" ;;
|
||||||
R) redownload="true" ;;
|
R) redownload="true" ;;
|
||||||
r) game_removal ;;
|
r) game_removal ;;
|
||||||
@@ -890,8 +1100,10 @@ while getopts "${args}" i ; do
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
u) game_update ;;
|
u) game_update ;;
|
||||||
|
U) action_menu; exit $? ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
[[ "${noCache}" == "true" ]] && :
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
Reference in new issue
Block a user