From 98ae684f7ae0f45852d22541ba56a37a1602a7dc Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 22 Apr 2026 22:16:11 -0400 Subject: [PATCH] RHVoice updates. --- etc/RHVoice | 1 + .../stormux/.local/.functions/install_game.sh | 43 +++++++++++++ .../.local/bin/stormux_launch_helpers.sh | 38 +++++++++++ home/stormux/.local/etc/RHVoice/RHVoice.conf | 64 +++++++++++++++++++ .../etc/RHVoice/dicts/English/namefix.txt | 9 +++ .../etc/RHVoice/dicts/English/wordfix.txt | 41 ++++++++++++ 6 files changed, 196 insertions(+) create mode 120000 etc/RHVoice create mode 100644 home/stormux/.local/etc/RHVoice/RHVoice.conf create mode 100644 home/stormux/.local/etc/RHVoice/dicts/English/namefix.txt create mode 100644 home/stormux/.local/etc/RHVoice/dicts/English/wordfix.txt diff --git a/etc/RHVoice b/etc/RHVoice new file mode 120000 index 0000000..ecbc135 --- /dev/null +++ b/etc/RHVoice @@ -0,0 +1 @@ +/home/stormux/.local/etc/RHVoice \ No newline at end of file diff --git a/home/stormux/.local/.functions/install_game.sh b/home/stormux/.local/.functions/install_game.sh index d83b21f..f1b9d96 100755 --- a/home/stormux/.local/.functions/install_game.sh +++ b/home/stormux/.local/.functions/install_game.sh @@ -4,6 +4,9 @@ set -euo pipefail scriptDir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" installerPath="${1:-}" +logRoot="${STORMUX_LOG_ROOT:-${HOME}/Logs}" +logDir="${logRoot}/installs" +logFile="" if [[ -z "${installerPath}" || ! -f "${installerPath}" ]]; then printf 'Usage: %s installer.sh\n' "${0##*/}" >&2 @@ -21,7 +24,47 @@ fex="${fex:-}" export installPath cache launchRoot redownload ipfsGateway fex gameName +safe_log_name() { + local name="$1" + + name="${name//\//_}" + name="${name//[^[:alnum:]. _-]/_}" + printf '%s\n' "$name" +} + +prune_old_logs() { + find "$logDir" -type f -name '*.log' -mtime +7 -delete 2> /dev/null || true +} + +setup_logging() { + local timestamp + local safeName + + mkdir -p "$logDir" + prune_old_logs + timestamp="$(date '+%Y%m%d-%H%M%S')" + safeName="$(safe_log_name "$gameName")" + logFile="${logDir}/${safeName}-${timestamp}.log" + exec > >(tee -a "$logFile") 2>&1 + printf 'Installing %s [%s]\n' "$gameName" "$(date)" + printf 'Installer path: %s\n' "$installerPath" +} + +finish_logging() { + local exitCode=$? + + if [[ "$exitCode" -eq 0 ]]; then + printf '%s installed [%s]\n' "$gameName" "$(date)" + else + printf '%s installation failed with exit code %s [%s]\n' "$gameName" "$exitCode" "$(date)" + speak "${gameName} installation failed. Check ${logFile} for details." 1 + fi + exit "$exitCode" +} + mkdir -p "${installPath}" "${cache}" "${launchRoot}" +setup_logging +trap finish_logging EXIT # shellcheck disable=SC1091 source "${scriptDir}/game_install_functions.sh" diff --git a/home/stormux/.local/bin/stormux_launch_helpers.sh b/home/stormux/.local/bin/stormux_launch_helpers.sh index 0c77355..aa6d447 100755 --- a/home/stormux/.local/bin/stormux_launch_helpers.sh +++ b/home/stormux/.local/bin/stormux_launch_helpers.sh @@ -3,6 +3,36 @@ export installPath="${installPath:-${HOME}/.local/games}" export fex="${fex:-}" +logRoot="${STORMUX_LOG_ROOT:-${HOME}/Logs}" +launchLogDir="${logRoot}/launches" +launchLogFile="" + +safe_log_name() { + local name="$1" + + name="${name//\//_}" + name="${name//[^[:alnum:]. _-]/_}" + printf '%s\n' "$name" +} + +prune_old_launch_logs() { + mkdir -p "$launchLogDir" + find "$launchLogDir" -type f -name '*.log' -mtime +7 -delete 2> /dev/null || true +} + +setup_launch_logging() { + local launchName="$1" + local timestamp + local safeName + + prune_old_launch_logs + timestamp="$(date '+%Y%m%d-%H%M%S')" + safeName="$(safe_log_name "$launchName")" + launchLogFile="${launchLogDir}/${safeName}-${timestamp}.log" + exec > >(tee -a "$launchLogFile") 2>&1 + printf 'Launching %s [%s]\n' "$launchName" "$(date)" +} + start_screen_reader() { cthulhu & } @@ -155,6 +185,7 @@ find_launch_script() { dispatch_launch_request() { local launchScript="${STORMUX_LAUNCH_SCRIPT:-}" + local launchName="${GAME:-}" if [[ -z "$launchScript" && -n "${GAME:-}" ]]; then launchScript="$(find_launch_script "$GAME" || true)" @@ -165,11 +196,18 @@ dispatch_launch_request() { printf 'Launch script not found: %s\n' "$launchScript" >&2 return 1 fi + if [[ -z "$launchName" ]]; then + launchName="${launchScript##*/}" + launchName="${launchName%.sh}" + fi + setup_launch_logging "$launchName" + printf 'Launch script: %s\n' "$launchScript" # shellcheck source=/dev/null source "$launchScript" return $? fi + setup_launch_logging "${launchName:-unknown}" case "${GAME:-}" in "") printf 'No game specified.\n' >&2 diff --git a/home/stormux/.local/etc/RHVoice/RHVoice.conf b/home/stormux/.local/etc/RHVoice/RHVoice.conf new file mode 100644 index 0000000..4cd70a7 --- /dev/null +++ b/home/stormux/.local/etc/RHVoice/RHVoice.conf @@ -0,0 +1,64 @@ +; Sample of the configuration file. +; To make changes, uncomment and edit the required parameters. +; For more information, please consult the documentation at https://github.com/RHVoice/RHVoice/tree/master/doc/en/Configuration-file.md + +; The default pitch, speed, and volume. +; In the client settings they will correspond to fifty percent. +; default_pitch=1.0 +; default_rate=1.0 +; default_volume=1.0 + +; Minimum and maximum pitch values. +; min_pitch=0.5 +; max_pitch=2.0 + +; Minimum and maximum speech rate values. +; min_rate=0.5 +max_rate=5.0 + +; Minimum and maximum volume values. +; min_volume=0.25 +; max_volume=2.0 + +; For this and higher speach rate values, the Sonic library is used. +; min_sonic_rate=1 + +; The following settings allow you to disable a specific language or voice. +; languages.english.enabled=false +; voices.elena.enabled=false + +; The symbol, which in the text will indicate that the vowel after sign must receive stress. +; Applies only to Russian and Ukrainian languages. +; stress_marker= + +; Punctuation mode (all, some or none). +; punctuation_mode=some + +; Characters pronounced in the (some) punctuation mode. +punctuation_list=+#61;<>~@#35;$%^&*| + +; Indication of capital letters when reading character by character. +; Possible values: no, word, pitch, sound +; indicate_capitals=no +; cap_pitch_factor=1.3 + +; In auto language switching mode, always switch to the primary language. +; when reading numbers and punctuation marks. +; prefer_primary_language=true + +; Enable pseudo-English support for Russian voices. +; languages.Russian.use_pseudo_english=true +; Windows only: return numeric English ID for Esperanto. +; languages.esperanto.present_as_english=false + +; Speech quality: min (maximum speed), +; standard (standard quality) or max (maximum possible quality, +; but with delays in the synthesis of long sentences). +quality=max + +; List of voice profiles. The first in the profile indicates the main +; voice (it will read numbers and other text for which automatic language determining fails). +; The following are additional voices. If the profile has two voices, whose languages ‹have common +; letters, the second will only be used when the Client will +; specifically request to use it. +voice_profiles=Aleksandr+Alan,Elena+CLB diff --git a/home/stormux/.local/etc/RHVoice/dicts/English/namefix.txt b/home/stormux/.local/etc/RHVoice/dicts/English/namefix.txt new file mode 100644 index 0000000..d516a6b --- /dev/null +++ b/home/stormux/.local/etc/RHVoice/dicts/English/namefix.txt @@ -0,0 +1,9 @@ +alicia=aleesha +bifrost=buyfraust +copyparty=coppeeparty +cthulhu=kthoolu +danestange=dainstanggey +godot=guhdoe +kae=kay* +kde=kaydeee +stange=stangey diff --git a/home/stormux/.local/etc/RHVoice/dicts/English/wordfix.txt b/home/stormux/.local/etc/RHVoice/dicts/English/wordfix.txt new file mode 100644 index 0000000..b27ab9e --- /dev/null +++ b/home/stormux/.local/etc/RHVoice/dicts/English/wordfix.txt @@ -0,0 +1,41 @@ +aa=dubbelaye +asus=aysus +bournemouth=bornmouth +certificate=cirtifficate +configure=kunfigure +disconnects=disconects +douche=doosh* +espeak=easpeak* +firepit=fiarpit +foliage=foalyage +freenginx=freeenginex +fyshoil=fishoil +git=ghit* +github=ghittehub +gitea=ghittee +inflatable=inflatable* +jolla=yolla +irssi=earsy +jenux=jennux +lightnin=lighttnin +mapper=mappper +messaged=mesaged +nginx=enginex +reading=reding +recognise=recognize +reconnection=reconection +reconnected=reconected +rhvoice=ahraychvoice +scarecrow=scaircrow +shit=shitt +singleplayer=singelplayer +snakebite=snaikbite +sync=sink* +teapots=teapotts +timezone=timezoan +unmodified=unmoddified +unranked=unraynked +vinux=vinnux +whatsapp=watsap +wench=wentch* +youngin=younggin*