key-handler 454 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh --
  2. set -ue
  3. exif_cmd='exiv2 -q -pa'
  4. while IFS='' read -r file; do
  5. case "${1:?}" in
  6. 'n')
  7. basename "${file}" | xclip -sel c -r
  8. ;;
  9. 'p')
  10. realpath "${file}" | xclip -sel c -r
  11. ;;
  12. 'd')
  13. exec dragon -x "${file}"
  14. ;;
  15. 'y')
  16. convert "${file}" png:- | xclip -sel c -t image/png
  17. ;;
  18. 'e')
  19. # shellcheck disable=2016
  20. exec swallow "${TERMINAL:-st}" -t "${file}" -e sh -c \
  21. "${exif_cmd}"' -- "${0}" | less -RS' "${file}"
  22. ;;
  23. esac
  24. done