Skip to content

Commit

Permalink
feat: “open with...” support
Browse files Browse the repository at this point in the history
  • Loading branch information
hraban committed Jul 2, 2024
1 parent 3b8bec7 commit f80a5a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,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:<kbd>@@⌘ space@@html:</kbd>@@.

Expand Down
11 changes: 10 additions & 1 deletion main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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*)))
Expand Down

0 comments on commit f80a5a7

Please sign in to comment.