-
Notifications
You must be signed in to change notification settings - Fork 0
/
gif-anim-select-area
executable file
·37 lines (34 loc) · 1.18 KB
/
gif-anim-select-area
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
#!/bin/bash
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
SETTINGS="$SCRIPTPATH/gif-anim-settings"
. "$SETTINGS" || {
echo "Error running '$SETTINGS' to get settings" >&2;
exit 1;
}
mkdir -p "$ga_dir_base"
mkdir -p "$ga_dir_frames"
# Attempt to ensure some security by changing to the frames cache dir
# and removing the files with the image extension from there.
# ...instead of the earlier version that did:
# rm "$ga_dir_frames"/*."$ga_frame_ext"
# We do it in a subshell so we don't change directories here,
# not that # it matters much, since nothing else is done
# that's dependent on the current dir.
echo
echo "Wiping prior session frames: $ga_dir_frames/*.$ga_frame_ext"
(cd "$ga_dir_frames" && rm *."$ga_frame_ext" 2>/dev/null)
echo "Removing lockfile, if it's there: $ga_framecap_lock_fn"
[[ -f $ga_framecap_lock_fn ]] && rm "$ga_framecap_lock_fn"
printf '%s' "$ga_hotkey_comments"
if [ -z "$WAYLAND_DISPLAY" ]; then
co="$(slop)"
else
co="$(slurp)"
fi
# co=285x184+289+669 # Test
echo "Coordinates chosen: $co"
echo "$co" > "$ga_fn_coords"
echo "Coordinates written to: $ga_fn_coords"
echo "Frames folder cleared: $ga_dir_frames/*"
echo "Ready for gif-anim-cap-frame"