added PKGBUILD and updated config location
This commit is contained in:
parent
6878c8b77d
commit
efb7e52a14
6 changed files with 65 additions and 9 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -28,3 +28,10 @@ ENV/
|
||||||
env.bak/
|
env.bak/
|
||||||
venv.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
|
## Setup
|
||||||
|
|
||||||
1. **Configure:**
|
1. **Configure:**
|
||||||
Copy the example config and edit it with your details.
|
Create the configuration directory and copy the example config.
|
||||||
```bash
|
```bash
|
||||||
cp config.example.json config.json
|
mkdir -p ~/.config/xivlauncher-wrapper
|
||||||
nano config.json
|
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).
|
* `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`).
|
* `launcher_cmd`: The command to launch XIVLauncher (default: `xivlauncher-core`).
|
||||||
|
|
|
||||||
17
wrapper.py
17
wrapper.py
|
|
@ -62,13 +62,22 @@ def send_otp(secret):
|
||||||
print("Timed out waiting for XIVLauncher OTP prompt.")
|
print("Timed out waiting for XIVLauncher OTP prompt.")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Determine config path (look in script directory)
|
# 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):
|
||||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
config_path = os.path.join(script_dir, "config.json")
|
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):
|
if not os.path.exists(config_path):
|
||||||
print(f"Config file not found at: {config_path}")
|
print(f"Config file not found.")
|
||||||
print("Please copy config.example.json to config.json and fill in your secret.")
|
print(f"Expected at: {config_path}")
|
||||||
|
print(f"Please copy config.example.json to {config_path} and fill in your secret.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
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