-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisp.sh
More file actions
executable file
·44 lines (42 loc) · 983 Bytes
/
disp.sh
File metadata and controls
executable file
·44 lines (42 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
function date_fix {
key_input=""
last_disp_job=""
date_format="%Y:%m:%d %H:%m"
current_date=$(date "+$date_format")
echo "$current_date"
for filename in "$1/"*.jpg; do
echo $filename
magick display -resize 600 "$filename" &
last_disp_job=$!
while :
do
read -rsn1 key_input
case $key_input in
j)
current_date=$(date -jv +1d -f "$date_format" "$current_date" "+$date_format")
echo $current_date
;;
k)
current_date=$(date -jv -1d -f "$date_format" "$current_date" "+$date_format")
echo $current_date
;;
i)
current_date=$(date -jv -1M -f "$date_format" "$current_date" "+$date_format")
echo $current_date
;;
o)
current_date=$(date -jv +1M -f "$date_format" "$current_date" "+$date_format")
echo $current_date
;;
g)
exiftool -AllDates="$current_date" "$filename"
kill $last_disp_job
break
;;
esac
done
done
rm -rf "$1/"*_original
}
date_fix "$1"