diff options
Diffstat (limited to '.bin/screen-copy')
-rwxr-xr-x | .bin/screen-copy | 22 |
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 $@ |