diff --git a/README.md b/README.md index 7bb562c..056b2ba 100644 --- a/README.md +++ b/README.md @@ -1,61 +1,64 @@ # XIVLauncher OTP Wrapper -This is a simple wrapper script for Linux that launches `xivlauncher-core` and automatically injects your One-Time Password (OTP) when the launcher requests it. +This is a wrapper script for Linux that launches `xivlauncher-core` (Native or Flatpak) and automatically injects your One-Time Password (OTP) when the launcher requests it. -## Setup +## Features + +- **Auto-Detection**: Automatically detects if you are using the native `xivlauncher-core` (Arch/AUR) or the Flatpak version. +- **OTP Injection**: Generates TOTP codes and sends them to the launcher's internal server. +- **URL Support**: Accepts standard Base32 secrets OR full `otpauth://` URLs (e.g. from QR codes). +- **Auto-Configuration**: Prompts to fix `launcher.ini` settings if they are incorrect. + +## Installation (Steam Deck / Linux Desktop) + +The easiest way to install is using the provided installer script. + +1. **Run the Installer:** + ```bash + ./installer.sh + ``` +2. **Enter Secret:** + When prompted, enter your **TOTP Secret** or paste a full **otpauth:// URL**. + +**What it does:** +* Creates `~/.config/xivlauncher-wrapper/config.json`. +* Installs the wrapper to `~/.local/bin/xivlauncher-wrapper`. +* Installs a `.desktop` file to `~/.local/share/applications/` so it appears in your application menu. + +### Steam Integration (Steam Deck) +1. Switch to Desktop Mode. +2. Open Steam. +3. "Games" -> "Add a Non-Steam Game to My Library". +4. Select "XIVLauncher Wrapper" from the list. +5. Return to Gaming Mode and launch "XIVLauncher Wrapper". + +## Manual Setup 1. **Configure:** - Create the configuration directory and copy the example config. ```bash mkdir -p ~/.config/xivlauncher-wrapper cp config.example.json ~/.config/xivlauncher-wrapper/config.json nano ~/.config/xivlauncher-wrapper/config.json ``` - * `secret`: Enter your TOTP secret key (in Base32 format, usually provided when you set up your authenticator app). - * `launcher_cmd`: The command to launch XIVLauncher (default: `xivlauncher-core`). + * `secret`: Enter your TOTP secret key or `otpauth://` URL. + * `launcher_cmd`: (Optional) The command to launch XIVLauncher. If omitted, the wrapper will auto-detect it. 2. **Make Executable:** - Ensure the script is executable: ```bash chmod +x wrapper.py ``` 3. **XIVLauncher Settings:** - Ensure that "Enable XL Authenticator app/OTP macro support" is enabled in XIVLauncher settings. + Ensure that "Enable XL Authenticator app/OTP macro support" is enabled in XIVLauncher settings. The wrapper will check for this and prompt you if it's disabled. ## Usage -Simply run the wrapper instead of the launcher: +Simply run the wrapper: ```bash ./wrapper.py ``` -The script will: -1. Launch XIVLauncher. -2. Wait for the launcher to start its local HTTP server (port 4646). -3. Generate the current OTP code. -4. Send it to the launcher automatically. +Or launch "XIVLauncher Wrapper" from your application menu/Steam. -## Steam Deck / Linux Desktop Installation - -For Steam Deck or standard Linux desktop users, you can use the provided installer script to set everything up automatically. - -1. **Run the Installer:** - ```bash - ./install-steamdeck.sh - ``` - Follow the prompts to enter your OTP secret. - -2. **What it does:** - * Creates the configuration file with your secret. - * Installs the wrapper to `~/.local/bin/xivlauncher-wrapper`. - * Installs a `.desktop` file to `~/.local/share/applications/` so it appears in your application menu (and can be added to Steam as a non-Steam game). - -3. **Steam Integration:** - * Switch to Desktop Mode. - * Open Steam. - * "Games" -> "Add a Non-Steam Game to My Library". - * Select "XIVLauncher Wrapper" from the list. - * Return to Gaming Mode and launch "XIVLauncher Wrapper". diff --git a/config.example.json b/config.example.json index 7157883..228cb47 100644 --- a/config.example.json +++ b/config.example.json @@ -1,4 +1,3 @@ { - "secret": "YOUR_BASE32_SECRET_HERE", - "launcher_cmd": "xivlauncher-core" + "secret": "YOUR_BASE32_SECRET_HERE" } \ No newline at end of file diff --git a/install-steamdeck.sh b/installer.sh similarity index 90% rename from install-steamdeck.sh rename to installer.sh index 5b612c1..bf2447a 100755 --- a/install-steamdeck.sh +++ b/installer.sh @@ -2,14 +2,14 @@ CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/xivlauncher-wrapper" CONFIG_FILE="$CONFIG_DIR/config.json" -LAUNCHER_CMD="flatpak run dev.goats.xivlauncher" + # Install paths BIN_DIR="$HOME/.local/bin" APP_DIR="$HOME/.local/share/applications" ICON_DIR="$HOME/.local/share/icons/hicolor/512x512/apps" -echo "XIVLauncher Wrapper - Steam Deck Installer" +echo "XIVLauncher Wrapper - Installer" echo "==========================================" # Create config directory if it doesn't exist @@ -27,8 +27,8 @@ fi if [ "$SETUP_CONFIG" = true ]; then echo "We will now set up the configuration file." - echo "You will need your generic TOTP secret (base32 format)." - read -p "Enter your TOTP Secret: " SECRET + echo "You will need your generic TOTP secret (base32 format) OR a full otpauth:// URL." + read -p "Enter your TOTP Secret or URL: " SECRET if [ -z "$SECRET" ]; then echo "Error: Secret cannot be empty." @@ -40,12 +40,11 @@ if [ "$SETUP_CONFIG" = true ]; then cat > "$CONFIG_FILE" <