fix(hypr): make sure wf-recorder saves in /tmp/*

This commit is contained in:
Price Hiller 2022-09-18 18:40:13 -05:00
parent 5685b248fe
commit b2df9370a4

View File

@ -23,13 +23,16 @@ mk-gif() {
else else
local input_tmpfile local input_tmpfile
notify-send "Starting ${program_name}" "Recording GIF of Selected Region" -a "${program_name}" notify-send "Starting ${program_name}" "Recording GIF of Selected Region" -a "${program_name}"
input_tmpfile="/tmp/$(mktemp wf-recorder.XXXXXXXXXXX).mp4" (
wf-recorder -g "$(slurp)" -f "${input_tmpfile}" & cd "/tmp"
printf "%s" $! >"${pid_file}" input_tmpfile="/tmp/$(mktemp wf-recorder.XXXXXXXXXXX).mp4"
wait wf-recorder -g "$(slurp)" -f "${input_tmpfile}" &
gifski "${input_tmpfile}" --output "${input_tmpfile}.gif" printf "%s" $! >"${pid_file}"
wl-copy --type image/gif <"${input_tmpfile}.gif" wait
rm -f "${pid_file}" gifski "${input_tmpfile}" --output "${input_tmpfile}.gif"
wl-copy --type image/gif <"${input_tmpfile}.gif"
rm -f "${pid_file}"
)
fi fi
} }