From a7fc5cb52e6d50c8a9dc4966dae4415ea4d79d62 Mon Sep 17 00:00:00 2001 From: Hraban Luyat Date: Mon, 1 Jul 2024 23:11:30 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=80=9Copen=20with...=E2=80=9D=20supp?= =?UTF-8?q?ort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.org | 2 +- main.lisp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 6cd2d21..994d76b 100644 --- a/README.org +++ b/README.org @@ -6,7 +6,7 @@ Use the home-manager module to "fix" your .app launchers: - Pinning in Dock works across updates - Launch from Spotlight -- Create .app wrappers for non-app bundle, stand-alone binary programs +- Support “open with...” Now you can launch Nix-installed apps using only your keyboard, using @@html:@@⌘ space@@html:@@. diff --git a/main.lisp b/main.lisp index 80e23fe..92b6233 100755 --- a/main.lisp +++ b/main.lisp @@ -150,7 +150,16 @@ (rsync :include "*.icns" :exclude "*" :recursive ,from-cnts ,to-cnts))))) (defun mktrampoline-app (app trampoline) - (let ((cmd (format NIL "tell application \"~A\" to activate" app))) + ;; TODO: how do you pass the argv? + (let ((cmd (format NIL " +on run argv + tell application \"~A\" to activate +end run + +on open names + tell application \"~:*~A\" to open names +end open +" app))) (sh `("/usr/bin/osacompile" #\o ,trampoline #\e ,cmd)) (sync-icons app trampoline) (copy-paths (infoplist app) (infoplist trampoline) *copyable-app-props*)))