A gif screen recorder
karta0807913 opened this issue · 1 comments
karta0807913 commented
Hi, I made a "block" to record the screen as a GIF.
But there are some problems.
Expected behavior
copy the result file (or filename) to clipboard
Actual behavior
xclip keep working in the background, blocking the entire i3.
bash
#!/bin/sh
ROOT="$(dirname "$0")"
RECORD_TMP_FILE="${ROOT}/.recording"
if [ -f "${RECORD_TMP_FILE}" ]; then
read filename < ${RECORD_TMP_FILE}
rm "${RECORD_TMP_FILE}"
# remove this line to solve the problem
echo ${filename} | xclip -selection clipboard
notify-send "Record Done" "Screen record filename is in the clipboard"
echo "⭕ ready"
elif [ ! "$BLOCK_BUTTON" = "1" ]; then
# notify-send "Record Message" "Left Button to start record"
echo "⭕ ready"
else
filename="$(mktemp)"
position="$(slop -o -f "--x=%x --y=%y --width=%w --height=%h")"
if [ "$position" = "" ]; then
echo "⭕ ready"
rm "$filename"
else
echo $filename > "${RECORD_TMP_FILE}"
nohup byzanz-record ${position} -e "tail --follow=name ${RECORD_TMP_FILE}" $filename >/dev/null 2>&1 &
echo "🔴 recording (click to stop)"
fi
fi
config
[screen_gif]
interval=once
Can anyone give me some suggestions?
Thanks a lot.
karta0807913 commented
Let the recorded file be opened in the browser to solve this problem