summaryrefslogtreecommitdiffstats
path: root/fb.in
diff options
context:
space:
mode:
authorMoritz Wilhelmy <moritz+git@wzff.de>2012-03-14 00:32:16 +0100
committerMoritz Wilhelmy <moritz+git@wzff.de>2012-03-14 00:32:16 +0100
commit94f4fc3c37e03296a54a9d934249898fde7f3b22 (patch)
tree826fa05759776a67839835d8ba8671a5ff8728ef /fb.in
parent400edb7fc13a5b3aa12040c82504b175c7f0982e (diff)
fix stat and clipboard calls for Darwin
Diffstat (limited to 'fb.in')
-rw-r--r--fb.in6
1 files changed, 4 insertions, 2 deletions
diff --git a/fb.in b/fb.in
index 4c1eacf..3716bd9 100644
--- a/fb.in
+++ b/fb.in
@@ -27,10 +27,12 @@ CLIPBOARD=""
EXITCODE=0
# the calling conventions for stat(1) are highly system dependent
-STAT='stat -c %s' # GNU stat(1) is the default since most people have it
+STAT='stat -c %s' # GNU stat(1) is the default since most people have it
+CLIPBOARD_CMD=xclip # also default to X11
case "`uname -s`" in
*BSD) STAT='stat -f %z';;
Minix) STAT='stat -size';;
+ Darwin)STAT='stat -f %z'; CLIPBOARD_CMD=pbcopy;;
esac
do_upload() {
@@ -192,7 +194,7 @@ else
fi
if [ "$CLIPBOARD" != "" ]; then
- type xclip >/dev/null 2>&1 && echo -n $CLIPBOARD | nohup xclip >/dev/null 2>&1
+ type $CLIPBOARD_CMD >/dev/null 2>&1 && echo -n $CLIPBOARD | nohup $CLIPBOARD_CMD >/dev/null 2>&1
fi
exit $EXITCODE