summaryrefslogtreecommitdiffstats
path: root/.bin/screen-copy
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-23 18:28:03 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-23 18:28:03 +0000
commit0f08d04698c814955116b6bae50752e64b774d8f (patch)
tree8cf9a33557093eebfd25aab2872e97639c7e2f62 /.bin/screen-copy
downloaddots-0f08d04698c814955116b6bae50752e64b774d8f.tar.gz
Thu Dec 23 06:28:03 PM UTC 2021
Diffstat (limited to '.bin/screen-copy')
-rwxr-xr-x.bin/screen-copy22
1 files changed, 22 insertions, 0 deletions
diff --git a/.bin/screen-copy b/.bin/screen-copy
new file mode 100755
index 0000000..9078dfb
--- /dev/null
+++ b/.bin/screen-copy
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Copy screen area to clipboard
+
+. ~/.bin/tenv
+
+main() {
+ filename="/tmp/screenshot-$(date +%F_%T).png"
+
+ case "${_DISPLAY_SERVER}" in
+ xorg)
+ scrot -s "${filename}"
+ xclip -selection clip -t image/png "${filename}"
+ ;;
+ *)
+ echo " display server not supported" >&2
+ ;;
+ esac
+
+}
+
+main $@
remember that computers suck.