# HG changeset patch # User Steve Losh # Date 1599061513 14400 # Node ID 1aa2e5785e6f87920bb6b099bbbe849cafd761b1 # Parent d6cc6af60002c22b03ba97c5d6989c2ffdda4698 Make pbcopy/pbpaste executables configurable diff -r d6cc6af60002 -r 1aa2e5785e6f package.lisp --- a/package.lisp Mon Aug 31 12:02:39 2020 -0400 +++ b/package.lisp Wed Sep 02 11:45:13 2020 -0400 @@ -113,7 +113,9 @@ (:export :sh :pbcopy - :pbpaste)) + :pbpaste + :*pbcopy-command* + :*pbpaste-command*)) (defpackage :losh.arrays diff -r d6cc6af60002 -r 1aa2e5785e6f src/shell.lisp --- a/src/shell.lisp Mon Aug 31 12:02:39 2020 -0400 +++ b/src/shell.lisp Wed Sep 02 11:45:13 2020 -0400 @@ -61,11 +61,17 @@ result))))) +(defparameter *pbcopy-command* "pbcopy" + "The shell command to use for `pbcopy`. When run, this command should set the clipboard contents to its standard input.") + +(defparameter *pbpaste-command* "pbpaste" + "The shell command to use for `pbpaste`. When run, this command should print the clipboard contents on standard output.") + (defun pbcopy (object) "`pbcopy` the `aesthetic-string` of `object`." - (sh "pbcopy" :input (format nil "~A" object) :wait nil) + (sh *pbcopy-command* :input (format nil "~A" object) :wait nil) (values)) (defun pbpaste () "`pbpaste` the current clipboard as a string." - (values (sh "pbpaste" :result-type 'string))) + (values (sh *pbpaste-command* :result-type 'string)))