🚀
One-click launch setup
Make openjk:// links open your game
The Launch in game buttons use an openjk:// link. JKA clients
(TaystJK / OpenJK / EternalJK) don't handle that scheme on their own, so this is a
one-time setup that registers a tiny wrapper: it validates the link and starts your
client with +set password <code> +connect host:port. Do it once; every
future join is one click. No setup? The join page always shows a command you can paste.
🖥 Windows
- Save this as
openjk-url.ps1(edit the$GameExepath to your client):
param([string]$Url)
# EDIT: full path to your JKA multiplayer client (TaystJK / OpenJK / EternalJK):
$GameExe = "C:\Games\TaystJK\eternaljk.x86_64.exe"
# openjk://<host>:<port>[/<code>] — strict validation is the security boundary.
if ($Url -notmatch '^openjk://([A-Za-z0-9.-]{1,253}):([0-9]{1,5})(?:/([A-Za-z0-9]{1,32}))?/?$') { exit 1 }
$h = $Matches[1]; $p = $Matches[2]; $code = $Matches[3]
$gameArgs = @()
if ($code) { $gameArgs += @('+set','password',$code) }
$gameArgs += @('+connect', "${h}:${p}")
Start-Process -FilePath $GameExe -ArgumentList $gameArgs
- Save this as
openjk.reg— edit the path to match where you put the.ps1— then double-click it to import (no admin needed, it's per-user):
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Classes\openjk] @="URL:OpenJK Protocol" "URL Protocol"="" [HKEY_CURRENT_USER\Software\Classes\openjk\shell\open\command] @="powershell -NoProfile -ExecutionPolicy Bypass -File \"C:\\Games\\TaystJK\\openjk-url.ps1\" \"%1\""
- Click a Launch in game button and allow the browser prompt. Done.
🍎 Linux
- Save as
~/.local/bin/openjk-url.sh(editGAME), thenchmod +xit:
#!/usr/bin/env bash
# EDIT: path to your JKA multiplayer client binary (or set $OPENJK_GAME):
GAME="${OPENJK_GAME:-$HOME/games/TaystJK/eternaljk.x86_64}"
url="$1"
# openjk://<host>:<port>[/<code>] — strict validation is the security boundary.
re='^openjk://([A-Za-z0-9.-]{1,253}):([0-9]{1,5})(/([A-Za-z0-9]{1,32}))?/?$'
[[ "$url" =~ $re ]] || { command -v notify-send >/dev/null && notify-send "OpenJK" "Invalid link"; exit 1; }
host="${BASH_REMATCH[1]}"; port="${BASH_REMATCH[2]}"; code="${BASH_REMATCH[4]}"
if [[ -n "$code" ]]; then exec "$GAME" +set password "$code" +connect "$host:$port"
else exec "$GAME" +connect "$host:$port"; fi
- Save as
~/.local/share/applications/openjk.desktop(edit theExecpath):
[Desktop Entry] Type=Application Name=OpenJK URL Handler Exec=/home/YOUR_USER/.local/bin/openjk-url.sh %u MimeType=x-scheme-handler/openjk; NoDisplay=true
- Register it:
xdg-mime default openjk.desktop x-scheme-handler/openjk update-desktop-database ~/.local/share/applications
🍏 macOS
- Open Script Editor, paste this (edit
gameExe), and Export as an Application named e.g.OpenJK URL.app:
-- EDIT: path to your client binary inside the .app (or a standalone binary):
property gameExe : "/Applications/TaystJK.app/Contents/MacOS/eternaljk"
on open location this_URL
-- strict validation is the security boundary
set ok to do shell script "echo " & quoted form of this_URL & " | grep -Eq '^openjk://[A-Za-z0-9.-]{1,253}:[0-9]{1,5}(/[A-Za-z0-9]{1,32})?/?$' && echo ok || true"
if ok is not "ok" then return
set body to text 10 thru -1 of this_URL -- drop 'openjk://'
set AppleScript's text item delimiters to "/"
set parts to text items of body
set hostport to item 1 of parts
set theCode to ""
if (count of parts) is greater than 1 then set theCode to item 2 of parts
set AppleScript's text item delimiters to ""
if theCode is not "" then
do shell script quoted form of gameExe & " +set password " & quoted form of theCode & " +connect " & quoted form of hostport & " > /dev/null 2>&1 &"
else
do shell script quoted form of gameExe & " +connect " & quoted form of hostport & " > /dev/null 2>&1 &"
end if
end open location
- Add this to the app's
Info.plist(right-click the .app → Show Package Contents → Contents/Info.plist), inside the top-level<dict>:
<key>CFBundleURLTypes</key> <array><dict> <key>CFBundleURLName</key><string>pro.playja.openjk</string> <key>CFBundleURLSchemes</key><array><string>openjk</string></array> </dict></array>
- Launch the app once so macOS registers the scheme, then use the buttons.
Security: each wrapper strictly validates the link before launching — it never
forwards raw + arguments to the game.