summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-08 17:23:03 -0500
committerJune McEnroe <june@causal.agency>2021-02-08 17:23:03 -0500
commitc3518f946f0a8c38d44aa103157df744fa9f37c4 (patch)
treee0676515964ca69af19624572f00eaea06b1632b /bin
parentSwap root window colours (diff)
downloadsrc-c3518f946f0a8c38d44aa103157df744fa9f37c4.tar.gz
src-c3518f946f0a8c38d44aa103157df744fa9f37c4.zip
Use xsel in up and add it do install.sh
Diffstat (limited to 'bin')
-rw-r--r--bin/up.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/up.sh b/bin/up.sh
index f55213d4..9cb77a2b 100644
--- a/bin/up.sh
+++ b/bin/up.sh
@@ -62,6 +62,14 @@ uploadTerminal() {
 	upload "${temp}/term.html"
 }
 
+copy() {
+	if type xsel >/dev/null; then
+		xsel -bi
+	else
+		pbcopy
+	fi
+}
+
 while getopts 'chst' opt; do
 	case "$opt" in
 		(c) fn=uploadCommand;;
@@ -76,5 +84,5 @@ shift $((OPTIND - 1))
 : ${fn:=upload}
 
 url=$($fn "$@")
-printf '%s' "$url" | pbcopy || true
+printf '%s' "$url" | copy || true
 echo "$url"