sxiv: Update key-handler and add 'C-d' to trash files
parent
f9977136e2
commit
415fa8621c
|
@ -1,16 +1,16 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
readonly KEY="$1"; shift
|
readonly KEY="$1"
|
||||||
|
|
||||||
orient() {
|
orient() {
|
||||||
for file in "$@"; do
|
while read file; do
|
||||||
mogrify -auto-orient "$file"
|
mogrify -auto-orient "$file"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
rotate() {
|
rotate() {
|
||||||
degree="$1"; shift
|
degree="$1"
|
||||||
for file in "$@"; do
|
while read file; do
|
||||||
case "$(file -b -i "$file")" in
|
case "$(file -b -i "$file")" in
|
||||||
image/jpeg*) jpegtran -rotate "$degree" -copy all -outfile "$file" "$file" ;;
|
image/jpeg*) jpegtran -rotate "$degree" -copy all -outfile "$file" "$file" ;;
|
||||||
*) mogrify -rotate "$degree" "$file" ;;
|
*) mogrify -rotate "$degree" "$file" ;;
|
||||||
|
@ -19,11 +19,12 @@ rotate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$KEY" in
|
case "$KEY" in
|
||||||
"C-c") echo -n "$@" | xsel -i ;;
|
"C-c") tr '\n' ' ' | xsel -i ;;
|
||||||
"C-e") for file in "$@"; do urxvt -bg "#444" -fg "#eee" -sl 0 -title "$file" -e sh -c "exiv2 pr -q -pa '$file' | less" & 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") gimp "$@" & ;;
|
"C-g") tr '\n' '\0' | xargs -0 gimp & ;;
|
||||||
"C-o") orient "$@" ;;
|
"C-o") orient ;;
|
||||||
"C-comma") rotate 270 "$@" ;;
|
"C-comma") rotate 270 ;;
|
||||||
"C-period") rotate 90 "$@" ;;
|
"C-period") rotate 90 ;;
|
||||||
"C-slash") rotate 180 "$@" ;;
|
"C-slash") rotate 180 ;;
|
||||||
|
"C-d") while read file; do trash "$file"; done ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue