From 6aaaab2ed914805efcbfe1ba6311c7646cea844f Mon Sep 17 00:00:00 2001 From: Sal3k <21336697+Sal3k@users.noreply.github.com> Date: Mon, 19 Oct 2026 11:24:51 +0200 Subject: [PATCH 1/2] Open .ink file passed on the command line on Linux The command-line file argument was only handled on Windows, so on Linux double-clicking an .ink file (or running 'inky story.ink') always opened an untitled story. Also use the matched argument instead of always argv[1], and resolve relative paths. Co-Authored-By: Claude Opus 5.5 --- app/main-process/main.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/main-process/main.js b/app/main-process/main.js index d49612c5..c1de44cd 100644 --- a/app/main-process/main.js +++ b/app/main-process/main.js @@ -267,12 +267,12 @@ app.on('ready', function () { } }); - // Windows passed file to open on command line? - if (process.platform == "win32" && process.argv.length > 1 && !pendingPathToOpen) { + // File passed to open on command line? (Windows file association, Linux .desktop %f, terminal) + if (process.platform != "darwin" && process.argv.length > 1 && !pendingPathToOpen) { for (let i = 1; i < process.argv.length; i++) { - var arg = process.argv[i].toLowerCase(); - if (arg.endsWith(".ink")) { - pendingPathToOpen = process.argv[1]; + var arg = process.argv[i]; + if (arg.toLowerCase().endsWith(".ink")) { + pendingPathToOpen = require("path").resolve(arg); break; } } From 7589e40a1f5296c09409393ab2d64f1754ae8991 Mon Sep 17 00:00:00 2001 From: Sal3k <21336697+Sal3k@users.noreply.github.com> Date: Mon, 19 Oct 2026 13:32:01 +0200 Subject: [PATCH 2/2] Pass the opened file to Inky in the .desktop entry Co-Authored by: Claude --- resources/com.inkle.inky.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/com.inkle.inky.desktop b/resources/com.inkle.inky.desktop index 75394eb6..83f09900 100755 --- a/resources/com.inkle.inky.desktop +++ b/resources/com.inkle.inky.desktop @@ -4,6 +4,6 @@ Type=Application Categories=Development;IDE; Name=Inky Comment=Inky -Exec=/opt/inky/Inky +Exec=/opt/inky/Inky %f Path=/opt/inky/ Icon=inky