summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-07 18:04:58 -0500
committerJune McEnroe <june@causal.agency>2021-02-07 18:07:07 -0500
commit8a637380b556760be922624584d3774c4952f8cf (patch)
tree21b1fc4c62b789d97fd52b169d021fd7a88df459 /bin
parentEnable mouse acceleration in X (diff)
downloadsrc-8a637380b556760be922624584d3774c4952f8cf.tar.gz
src-8a637380b556760be922624584d3774c4952f8cf.zip
Use scrot for up -s if no screencapture
Still missing putting the URL in an X selection.
Diffstat (limited to '')
-rw-r--r--bin/man1/up.18
-rw-r--r--bin/up.sh6
2 files changed, 11 insertions, 3 deletions
diff --git a/bin/man1/up.1 b/bin/man1/up.1
index 8b50c271..189020de 100644
--- a/bin/man1/up.1
+++ b/bin/man1/up.1
@@ -1,4 +1,4 @@
-.Dd January 12, 2021
+.Dd February  7, 2021
 .Dt UP 1
 .Os
 .
@@ -54,6 +54,8 @@ to produce an HTML file for upload.
 .It Fl s
 Use
 .Xr screencapture 1
+or
+.Xr scrot 1
 to produce a PNG file for upload.
 The file is optimized by
 .Xr pngo 1
@@ -72,5 +74,7 @@ Any arguments after
 are passed to
 .Xr hilex 1
 and
-.Xr screencapture 1 ,
+.Xr screencapture 1
+or
+.Xr scrot 1 ,
 respectively.
diff --git a/bin/up.sh b/bin/up.sh
index 562ab489..f55213d4 100644
--- a/bin/up.sh
+++ b/bin/up.sh
@@ -40,7 +40,11 @@ uploadHilex() {
 
 uploadScreen() {
 	temp
-	screencapture -i "$@" "${temp}/capture.png"
+	if type screencapture >/dev/null; then
+		screencapture -i "$@" "${temp}/capture.png"
+	else
+		scrot -s "$@" "${temp}/capture.png"
+	fi
 	pngo "${temp}/capture.png" || true
 	upload "${temp}/capture.png"
 }