From 677acd1a4fdf1875cf320b89331e8b4d1a2bb9c8 Mon Sep 17 00:00:00 2001 From: pse Date: Sat, 17 Aug 2024 16:35:53 +0200 Subject: [PATCH] Use pbcopy to copy to clipboard on macOS --- tmpmail | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tmpmail b/tmpmail index b5739d1..55c6ee3 100755 --- a/tmpmail +++ b/tmpmail @@ -13,7 +13,12 @@ browser="w3m" # The default command that will be used to copy the email address to # the user's clipboard when running 'tmpmail --copy' -copy_to_clipboard_cmd="xclip -selection c" +case $(uname) in + Linux) copy_to_clipboard_cmd="xclip -selection c" + ;; + Darwin) copy_to_clipboard_cmd="pbcopy" + ;; +esac # If the value is set to 'true' tmpmail will convert the HTML email # to raw text and send that to stdout