From 6dea5d5f98390d6b0b08ecc3dfb0ad01992c4f8c Mon Sep 17 00:00:00 2001 From: Nikita Hasert Date: Sun, 25 May 2025 10:41:31 +0200 Subject: [PATCH] Add install script for yomininja --- README.md | 19 +++++++++++++------ scripts/install_game2text | 25 ------------------------- scripts/install_yomininja | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 31 deletions(-) delete mode 100644 scripts/install_game2text create mode 100755 scripts/install_yomininja diff --git a/README.md b/README.md index 961bce2..564daca 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,11 @@ - [External Optical Drives](#external-optical-drives) - [Japanese Learning](#japanese-learning) - [./scripts/enable\_jp\_locale](#scriptsenable_jp_locale) - - [Installing Game2text](#installing-game2text) - - [Running the Windows Build Via Bottles](#running-the-windows-build-via-bottles) - - [Building Game2text From Source on the Steamdeck](#building-game2text-from-source-on-the-steamdeck) + - [OCR](#ocr) + - [Installing YomiNinja](#installing-yomininja) + - [Installing Game2text](#installing-game2text) + - [Running the Windows Build Via Bottles](#running-the-windows-build-via-bottles) + - [Building Game2text From Source on the Steamdeck](#building-game2text-from-source-on-the-steamdeck) - [Installing MPV and mpvacious](#installing-mpv-and-mpvacious) - [Japanese Input](#japanese-input) - [Anki](#anki) @@ -65,10 +67,15 @@ Enables the japanese locale on the steamdeck. Useful for learners of japanese th ```bash LANG=ja_JP 7zz x ``` +### OCR -### Installing Game2text +#### Installing YomiNinja -#### Running the Windows Build Via Bottles +Download the latest YomiNinja [AppImage](https://github.com/matt-m-o/YomiNinja/releases) and run it. See also `./scripts/install_yomininja` + +#### Installing Game2text + +##### Running the Windows Build Via Bottles [Game2text](https://game2text.com/) can be used via [bottles](https://usebottles.com/). @@ -78,7 +85,7 @@ LANG=ja_JP 7zz x 4. Setup a bottle optimized for gaming 5. Run Game2text inside the bottle you just created -#### Building Game2text From Source on the Steamdeck +##### Building Game2text From Source on the Steamdeck See: [Game2Text](https://github.com/mathewthe2/Game2Text) diff --git a/scripts/install_game2text b/scripts/install_game2text deleted file mode 100644 index 06fa41b..0000000 --- a/scripts/install_game2text +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# See: https://github.com/mathewthe2/Game2Text - -function make_game2text { - # The requirements may need to be slightly adjusted if e.g. the specific version of numpy is not available - # TODO: Replace == with >= in requirements.py automatically - # TODO: In config.ini replace `browser = default` with `browser = chromium` automatically - # See: https://game2text.com/faq/switch-browser/ - pip install -r requirements.txt -} - -sudo steamos-readonly disable && \ -sudo pacman base-devel glibc linux-api-headers zlib cmake python3 gcc nodejs npm libffi openssl rust tk tcl && \ -sudo steamos-readonly enable && \ -git clone https://github.com/mathewthe2/Game2Text.git && \ -cd Game2Text && \ -virtualenv venv --python='/usr/bin/python' && \ -source venv/bin/activate && \ -pip install virtualenv && \ -make_game2text && \ -deactivate - -# TODO: Create a script for this and put it on the path -echo 'Run "source venv/bin/activate && python game2text.py ; deactivate" to start game2text' diff --git a/scripts/install_yomininja b/scripts/install_yomininja new file mode 100755 index 0000000..04cc67a --- /dev/null +++ b/scripts/install_yomininja @@ -0,0 +1,36 @@ +#!/bin/bash + +function yes_or_no { + while true; do + read -p "$* [y/n]: " yn + case $yn in + [Yy]*) return 0 ;; + [Nn]*) return 1 ;; + esac + done +} + +function install_yomininja { + ymn="${HOME}/bin/yomininja" + + if [ -e ${ymn} ]; then + yes_or_no "yomininja is already installed, do you want to overwrite the existing installation?" + fi + + if [ $? -ne 0 ]; then + echo "Aborting install of yomininja." + return 0 + fi + + version=${1} + echo "Installing yomininja ${version}..." + ymnurl="https://github.com/matt-m-o/YomiNinja/releases/download/v${version}/YomiNinja-${version}.AppImage" + mkdir -p "$(dirname "$ymn")" + if [ -e ${ymn} ]; then + rm "$ymn" + fi + curl -fL "$ymnurl" -o "$ymn" + chmod u+x "$ymn" +} + +install_yomininja ${1}