From 9f0f8a2ce9264c2b72ca2dd7e1e0431323d32805 Mon Sep 17 00:00:00 2001 From: sudacode Date: Tue, 10 Feb 2026 23:23:25 -0800 Subject: [PATCH] Set SubMiner mpv launch defaults and doc naming consistency --- docs/configuration.md | 27 +++++---------------------- docs/installation.md | 28 ++++++++++++++-------------- docs/usage.md | 34 ++++++++++++++++++++++------------ subminer | 9 +++++++++ 4 files changed, 50 insertions(+), 48 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index fe17875..ffe404b 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -2,16 +2,16 @@ Settings are stored in `$XDG_CONFIG_HOME/SubMiner/config.jsonc` (or `~/.config/SubMiner/config.jsonc` when `XDG_CONFIG_HOME` is unset). For backward compatibility, SubMiner also reads existing configs from lowercase `subminer` directories. -### Configuration File +## Configuration File See [config.example.jsonc](/config.example.jsonc) for a comprehensive example configuration file with all available options, default values, and detailed comments. Only include the options you want to customize in your config file. Generate a fresh default config from the centralized config registry: ```bash -subminer.AppImage --generate-config -subminer.AppImage --generate-config --config-path /tmp/subminer.jsonc -subminer.AppImage --generate-config --backup-overwrite +SubMiner.AppImage --generate-config +SubMiner.AppImage --generate-config --config-path /tmp/subminer.jsonc +SubMiner.AppImage --generate-config --backup-overwrite ``` - `--generate-config` writes a default JSONC config template. @@ -22,7 +22,6 @@ subminer.AppImage --generate-config --backup-overwrite Invalid config values are handled with warn-and-fallback behavior: SubMiner logs the bad key/value and continues with the default for that option. - ### Configuration Options Overview The configuration file includes several main sections: @@ -43,7 +42,6 @@ The configuration file includes several main sections: - [**WebSocket Server**](#websocket-server) - Built-in subtitle broadcasting server - [**YouTube Subtitle Generation**](#youtube-subtitle-generation) - Launcher defaults for yt-dlp + local whisper fallback - ### AnkiConnect Enable automatic Anki card creation and updates with media generation: @@ -170,8 +168,6 @@ Kiku extends Lapis with **field grouping** — when a duplicate card is detected Open demo in a new tab - - | Mode | Behavior | | ---------- | -------------------------------------------------------------------------------------------------------------------------- | | `auto` | Automatically merges the new card's content into the original; duplicate deletion is controlled by `deleteDuplicateInAuto` | @@ -211,7 +207,6 @@ To copy multiple lines (current + previous): These shortcuts are only active when the overlay window is visible. They are automatically disabled when the overlay is hidden to avoid interfering with normal system clipboard operations. - ### Auto-Start Overlay Control whether the overlay automatically becomes visible when it connects to mpv: @@ -226,7 +221,7 @@ Control whether the overlay automatically becomes visible when it connects to mp | -------------------- | --------------- | ------------------------------------------------------ | | `auto_start_overlay` | `true`, `false` | Auto-show overlay on mpv connection (default: `false`) | -The mpv plugin now controls startup per layer via `auto_start_visible_overlay` and `auto_start_invisible_overlay` in `subminer.conf` (`platform-default` for invisible means hidden on Linux, visible on macOS/Windows). +The mpv plugin controls startup per layer via `auto_start_visible_overlay` and `auto_start_invisible_overlay` in `subminer.conf` (`platform-default` for invisible means hidden on Linux, visible on macOS/Windows). ### Visible Overlay Subtitle Binding @@ -242,7 +237,6 @@ Control whether toggling the visible overlay also toggles MPV subtitle visibilit | --------------------------------------------- | --------------- | ----------- | | `bind_visible_overlay_to_mpv_sub_visibility` | `true`, `false` | When `true` (default), visible overlay hides MPV primary/secondary subtitles and restores them when hidden. When `false`, visible overlay toggles do not change MPV subtitle visibility. | - ### Auto Subtitle Sync Sync the active subtitle track using `alass` (preferred) or `ffsubsync`: @@ -268,7 +262,6 @@ Sync the active subtitle track using `alass` (preferred) or `ffsubsync`: Default trigger is `Ctrl+Alt+S` via `shortcuts.triggerSubsync`. Customize it there, or set it to `null` to disable. - ### Invisible Overlay SubMiner includes a second subtitle mining layer that can be visually invisible while still interactive for Yomitan lookups. @@ -285,7 +278,6 @@ Invisible subtitle positioning can be adjusted directly in the invisible layer: - Press `Enter` or `Ctrl/Cmd+S` to save, or `Esc` to cancel. - This edit-mode shortcut is fixed (not currently configurable in `shortcuts`/`keybindings`). - ### Jimaku Configure Jimaku API access and defaults: @@ -306,7 +298,6 @@ Jimaku is rate limited; if you hit a limit, SubMiner will surface the retry dela Set `openBrowser` to `false` to only print the URL without opening a browser. - ### Keybindings Add a `keybindings` array to configure keyboard shortcuts that send commands to mpv: @@ -357,7 +348,6 @@ See `config.example.jsonc` for detailed configuration options and more examples. **See `config.example.jsonc`** for more keybinding examples and configuration options. - ### Runtime Option Palette Use the runtime options palette to toggle settings live while SubMiner is running. These changes are session-only and reset on restart. @@ -376,7 +366,6 @@ Palette controls: - `Enter`: apply selected value - `Esc`: close - ### Secondary Subtitles Display a second subtitle track (e.g., English alongside Japanese) in the overlay: @@ -407,7 +396,6 @@ See `config.example.jsonc` for detailed configuration options. **See `config.example.jsonc`** for additional secondary subtitle configuration options. - ### Shortcuts Configuration Customize or disable the overlay keyboard shortcuts: @@ -455,7 +443,6 @@ See `config.example.jsonc` for detailed configuration options. Set any shortcut to `null` to disable it. - ### Subtitle Position Set the initial vertical subtitle position (measured from the bottom of the screen): @@ -472,7 +459,6 @@ Set the initial vertical subtitle position (measured from the bottom of the scre | ---------- | --------------- | ------------------------------------------------------------------ | | `yPercent` | number (0 - 100) | Distance from the bottom as a percent of screen height (default: `10`) | - ### Subtitle Style Customize the appearance of primary and secondary subtitles: @@ -511,7 +497,6 @@ Secondary subtitle defaults: `fontSize: 24`, `fontColor: "#ffffff"`, `background **See `config.example.jsonc`** for the complete list of subtitle style configuration options. - ### Texthooker Control whether the browser opens automatically when texthooker starts: @@ -526,7 +511,6 @@ See `config.example.jsonc` for detailed configuration options. } ``` - ### WebSocket Server The overlay includes a built-in WebSocket server that broadcasts subtitle text to connected clients (such as texthooker-ui) for external processing. @@ -549,7 +533,6 @@ See `config.example.jsonc` for detailed configuration options. | `enabled` | `true`, `false`, `"auto"` | `"auto"` (default) disables if mpv_websocket is detected | | `port` | number | WebSocket server port (default: 6677) | - ### YouTube Subtitle Generation Set defaults used by the `subminer` launcher for YouTube subtitle extraction/transcription: diff --git a/docs/installation.md b/docs/installation.md index 5499ef4..d73ebae 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,4 +1,6 @@ -# Requirements +# Installation + +## Requirements ### Linux @@ -25,23 +27,21 @@ - yt-dlp (recommended for reliable YouTube playback/subtitles in mpv) - bun (required to run the `subminer` wrapper script from source/local installs) -## Installation - ### From AppImage (Recommended) -Download the latest AppImage from GitHub Releases: +Download the latest AppImage from [GitHub Releases](https://github.com/ksyasuda/SubMiner/releases/latest): ```bash # Download and install AppImage -wget https://github.com/sudacode/subminer/releases/download/v1.0.0/subminer-1.0.0.AppImage -O ~/.local/bin/subminer.AppImage -chmod +x ~/.local/bin/subminer.AppImage +wget https://github.com/ksyasuda/SubMiner/releases/download/v0.1.0/SubMiner-0.1.0.AppImage -O ~/.local/bin/SubMiner.AppImage +chmod +x ~/.local/bin/SubMiner.AppImage # Download subminer wrapper script -wget https://github.com/sudacode/subminer/releases/download/v1.0.0/subminer -O ~/.local/bin/subminer +wget https://github.com/ksyasuda/SubMiner/releases/download/v0.1.0/subminer -O ~/.local/bin/subminer chmod +x ~/.local/bin/subminer ``` -Note: the `subminer` wrapper uses a Bun shebang (`#!/usr/bin/env bun`), so `bun` must be installed and available on `PATH`. +Note: the `subminer` wrapper uses a Bun shebang (`#!/usr/bin/env bun`), so [Bun](https://bun.sh) must be installed and available on `PATH`. ### macOS Installation @@ -57,8 +57,8 @@ brew install mpv mecab mecab-ipadic Build from source: ```bash -git clone https://github.com/sudacode/subminer.git -cd subminer +git clone https://github.com/ksyasuda/SubMiner.git +cd SubMiner pnpm install cd vendor/texthooker-ui && pnpm install && pnpm build && cd ../.. pnpm run build:mac @@ -100,8 +100,8 @@ Set these GitHub Actions secrets before creating a release tag: ### From Source ```bash -git clone https://github.com/sudacode/subminer.git -cd subminer +git clone https://github.com/ksyasuda/SubMiner.git +cd SubMiner make build # Install platform artifacts @@ -227,8 +227,8 @@ The plugin auto-detects the binary location, searching: - `C:\Program Files\subminer\subminer.exe` - `C:\Program Files (x86)\subminer\subminer.exe` - `C:\subminer\subminer.exe` -- `~/.local/bin/subminer.AppImage` -- `/opt/subminer/subminer.AppImage` +- `~/.local/bin/SubMiner.AppImage` +- `/opt/SubMiner/SubMiner.AppImage` - `/usr/local/bin/subminer` - `/usr/bin/subminer` diff --git a/docs/usage.md b/docs/usage.md index 700d699..6667e82 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -31,22 +31,32 @@ subminer -p gpu-hq video.mkv # Override mpv profile subminer --yt-subgen-mode preprocess --whisper-bin /path/to/whisper-cli --whisper-model /path/to/model.bin https://youtu.be/... # Pre-generate subtitle tracks before playback # Direct AppImage control -subminer.AppImage --start --texthooker # Start overlay with texthooker -subminer.AppImage --texthooker # Launch texthooker only (no overlay window) -subminer.AppImage --stop # Stop overlay -subminer.AppImage --start --toggle # Start MPV IPC + toggle visibility -subminer.AppImage --start --toggle-invisible-overlay # Start MPV IPC + toggle invisible layer -subminer.AppImage --show-visible-overlay # Force show visible overlay -subminer.AppImage --hide-visible-overlay # Force hide visible overlay -subminer.AppImage --show-invisible-overlay # Force show invisible overlay -subminer.AppImage --hide-invisible-overlay # Force hide invisible overlay -subminer.AppImage --settings # Open Yomitan settings -subminer.AppImage --help # Show all options +SubMiner.AppImage --start --texthooker # Start overlay with texthooker +SubMiner.AppImage --texthooker # Launch texthooker only (no overlay window) +SubMiner.AppImage --stop # Stop overlay +SubMiner.AppImage --start --toggle # Start MPV IPC + toggle visibility +SubMiner.AppImage --start --toggle-invisible-overlay # Start MPV IPC + toggle invisible layer +SubMiner.AppImage --show-visible-overlay # Force show visible overlay +SubMiner.AppImage --hide-visible-overlay # Force hide visible overlay +SubMiner.AppImage --show-invisible-overlay # Force show invisible overlay +SubMiner.AppImage --hide-invisible-overlay # Force hide invisible overlay +SubMiner.AppImage --settings # Open Yomitan settings +SubMiner.AppImage --help # Show all options ``` ### MPV Profile Example (mpv.conf) -Add a profile to `~/.config/mpv/mpv.conf`; `subminer` now launches mpv with `--profile=subminer` by default (or override with `subminer -p ...`): +`subminer` passes the following MPV options directly on launch by default: + +- `--input-ipc-server=/tmp/subminer-socket` (or your configured socket path) +- `--slang=ja,jpn,en,eng` +- `--sub-auto=fuzzy` +- `--sub-file-paths=.;subs;subtitles` +- `--sid=auto` +- `--secondary-sid=auto` +- `--secondary-sub-visibility=no` + +You can define a matching profile in `~/.config/mpv/mpv.conf` for consistency when launching `mpv` manually or from other tools. `subminer` launches with `--profile=subminer` by default (or override with `subminer -p ...`): ```ini [subminer] diff --git a/subminer b/subminer index 41c1f99..87ea908 100755 --- a/subminer +++ b/subminer @@ -46,6 +46,14 @@ const DEFAULT_YOUTUBE_SUBGEN_OUT_DIR = path.join( "youtube-subs", ); const DEFAULT_YOUTUBE_YTDL_FORMAT = "bestvideo*+bestaudio/best"; +const DEFAULT_MPV_SUBMINER_ARGS = [ + "--sub-auto=fuzzy", + "--sub-file-paths=.;subs;subtitles", + "--sid=auto", + "--secondary-sid=auto", + "--secondary-sub-visibility=no", + "--slang=ja,jpn,en,eng", +] as const; type LogLevel = "debug" | "info" | "warn" | "error"; type YoutubeSubgenMode = "automatic" | "preprocess" | "off"; @@ -1723,6 +1731,7 @@ function startMpv( const mpvArgs: string[] = []; if (args.profile) mpvArgs.push(`--profile=${args.profile}`); + mpvArgs.push(...DEFAULT_MPV_SUBMINER_ARGS); if (targetKind === "url" && isYoutubeTarget(target)) { const subtitleLangs = uniqueNormalizedLangCodes([