summary refs log tree commit diff
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
commit0ada5af57f7df3911d0238330ef959e9af3b9305 (patch)
treeff0a9eb3f1d91995b865282f2ef2b0a106b3de41
parentSwap root window colours (diff)
downloadsrc-0ada5af57f7df3911d0238330ef959e9af3b9305.tar.gz
src-0ada5af57f7df3911d0238330ef959e9af3b9305.zip
Use xsel in up and add it do install.sh
-rw-r--r--bin/up.sh10
-rw-r--r--install.sh2
2 files changed, 10 insertions, 2 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"
diff --git a/install.sh b/install.sh
index e05ea760..cc80e226 100644
--- a/install.sh
+++ b/install.sh
@@ -17,7 +17,7 @@ FreeBSD() {
 
 OpenBSD() {
 	doas pkg_add $packages
-	test $X && doas pkg_add imv scrot xcursor-dmz
+	test $X && doas pkg_add imv scrot xcursor-dmz xsel
 }
 
 Linux() {