added PKGBUILD and updated config location
This commit is contained in:
parent
6878c8b77d
commit
efb7e52a14
6 changed files with 65 additions and 9 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
|
@ -27,4 +27,11 @@ venv/
|
|||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
config.json
|
||||
config.json
|
||||
|
||||
# makepkg artifacts
|
||||
pkg/
|
||||
src/
|
||||
*.pkg.tar.zst
|
||||
*.pkg.tar.xz
|
||||
*.log
|
||||
30
PKGBUILD
Normal file
30
PKGBUILD
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Maintainer: Cosmo
|
||||
pkgname=xivlauncher-wrapper
|
||||
pkgver=0.1.0
|
||||
pkgrel=1
|
||||
pkgdesc="Wrapper for XIVLauncher with OTP injection"
|
||||
arch=('any')
|
||||
url="https://github.com/goatcorp/XIVLauncher.Core"
|
||||
license=('MIT')
|
||||
depends=('python' 'xivlauncher')
|
||||
optdepends=()
|
||||
makedepends=('git')
|
||||
source=("xivlauncher-wrapper.desktop"
|
||||
"xivlauncher-wrapper.png"
|
||||
"wrapper.py"
|
||||
"config.example.json")
|
||||
sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP')
|
||||
|
||||
package() {
|
||||
# Install the wrapper script
|
||||
install -Dm755 "${srcdir}/wrapper.py" "${pkgdir}/usr/bin/${pkgname}"
|
||||
|
||||
# Install the desktop file
|
||||
install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
|
||||
|
||||
# Install the icon
|
||||
install -Dm644 "${srcdir}/${pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
|
||||
|
||||
# Install example config
|
||||
install -Dm644 "${srcdir}/config.example.json" "${pkgdir}/usr/share/doc/${pkgname}/config.example.json"
|
||||
}
|
||||
|
|
@ -5,10 +5,11 @@ This is a simple wrapper script for Linux that launches `xivlauncher-core` and a
|
|||
## Setup
|
||||
|
||||
1. **Configure:**
|
||||
Copy the example config and edit it with your details.
|
||||
Create the configuration directory and copy the example config.
|
||||
```bash
|
||||
cp config.example.json config.json
|
||||
nano config.json
|
||||
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`).
|
||||
|
|
|
|||
19
wrapper.py
19
wrapper.py
|
|
@ -62,13 +62,22 @@ def send_otp(secret):
|
|||
print("Timed out waiting for XIVLauncher OTP prompt.")
|
||||
|
||||
def main():
|
||||
# Determine config path (look in script directory)
|
||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
config_path = os.path.join(script_dir, "config.json")
|
||||
# Determine config path (XDG standard)
|
||||
xdg_config_home = os.environ.get('XDG_CONFIG_HOME', os.path.join(os.path.expanduser('~'), '.config'))
|
||||
config_dir = os.path.join(xdg_config_home, 'xivlauncher-wrapper')
|
||||
config_path = os.path.join(config_dir, 'config.json')
|
||||
|
||||
# Fallback to script directory (legacy/development)
|
||||
if not os.path.exists(config_path):
|
||||
print(f"Config file not found at: {config_path}")
|
||||
print("Please copy config.example.json to config.json and fill in your secret.")
|
||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
local_config = os.path.join(script_dir, "config.json")
|
||||
if os.path.exists(local_config):
|
||||
config_path = local_config
|
||||
|
||||
if not os.path.exists(config_path):
|
||||
print(f"Config file not found.")
|
||||
print(f"Expected at: {config_path}")
|
||||
print(f"Please copy config.example.json to {config_path} and fill in your secret.")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
|
|
|
|||
9
xivlauncher-wrapper.desktop
Normal file
9
xivlauncher-wrapper.desktop
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[Desktop Entry]
|
||||
Name=XIVLauncher Wrapper
|
||||
Comment=FFXIV Launcher with OTP Injection
|
||||
Exec=xivlauncher-wrapper
|
||||
Icon=xivlauncher-wrapper
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Game;
|
||||
Keywords=ffxiv;launcher;mmo;
|
||||
BIN
xivlauncher-wrapper.png
Normal file
BIN
xivlauncher-wrapper.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 380 KiB |
Loading…
Add table
Add a link
Reference in a new issue