From 9a08dcc3334fbafa6baf683d8c7aa578e4446afc Mon Sep 17 00:00:00 2001 From: willemml Date: Thu, 30 Nov 2023 12:41:41 -0800 Subject: [PATCH] Adds shell function - copy file to system clipboard --- home/darwin/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/home/darwin/default.nix b/home/darwin/default.nix index 735f219..641c5cc 100644 --- a/home/darwin/default.nix +++ b/home/darwin/default.nix @@ -42,6 +42,15 @@ else eval "$(/usr/local/bin/brew shellenv)" fi + + file-to-clipboard() { + filepath=$(realpath $1) + osascript \ + -e 'on run args' \ + -e "set the clipboard to POSIX file \"$filepath\"" \ + -e end \ + "$@" + } ''; targets.darwin = {