123456789101112131415161718192021222324252627282930313233343536 |
- #!/bin/sh
- rotate() {
- degree="$1"
- tr '\n' '\0' | xargs -0 realpath | sort | uniq | while read file; do
- case "$(file -b -i "$file")" in
- image/jpeg*) jpegtran -rotate "$degree" -copy all -outfile "$file" "$file" ;;
- *) mogrify -rotate "$degree" "$file" ;;
- esac
- done
- }
- case "$1" in
- "C-x") xclip -in -filter | tr '\n' ' ' | xclip -in -selection clipboard ;;
- "C-c") while read file; do convert "$file" png:- | xclip -selection clipboard -target "image/png"; done ;;
- "C-e") while read file; do urxvt -bg "#444" -fg "#eee" -sl 0 -title "$file" -e sh -c "exiv2 pr -q -pa '$file' | less" & done ;;
- "C-g") tr '\n' '\0' | xargs -0 gimp & ;;
- "C-r") while read file; do rawtherapee "$file" & done ;;
- "C-comma") rotate 270 ;;
- "C-period") rotate 90 ;;
- "C-slash") rotate 180 ;;
- "C-t") tr '\n' '\0' | xargs -0 img-chon.sh tag-dmenu
- esac
|