1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 $@