From 0f08d04698c814955116b6bae50752e64b774d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Thu, 23 Dec 2021 18:28:03 +0000 Subject: Thu Dec 23 06:28:03 PM UTC 2021 --- .bin/screen-copy | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 .bin/screen-copy (limited to '.bin/screen-copy') 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 $@ -- cgit v1.2.3