moving stuff arounf
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# Record GIFs for README.md files
|
||||
|
||||
On Fedora I use [wf-recorder](https://github.com/ammen99/wf-recorder) for recording screen to mp4, and [ffmpeg](https://www.ffmpeg.org/about.html) for post processing to .gif.
|
||||
|
||||
```bash
|
||||
wf-recorder -g "$(slurp)" \
|
||||
-f <MP4-FILE-NAME>.mp4 \
|
||||
-c libx264 \
|
||||
-r 30 \
|
||||
-p crf=18 \
|
||||
-p preset=slow
|
||||
```
|
||||
|
||||
like something like this
|
||||
```bash
|
||||
ffmpeg -i hagfish.mp4 \
|
||||
-vf "fps=15,scale=920:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=256:stats_mode=diff[p];[s1][p]paletteuse=dither=sierra2_4a" \
|
||||
-loop 0 \
|
||||
hagfish.gif
|
||||
```
|
||||
|
||||
keep the scale at 920, I think it looks good on Gitea and probably GitHub
|
||||
@@ -0,0 +1,43 @@
|
||||
So for like live updating or recompiling the pdf document with a justfile that looks like this in one terminal window
|
||||
|
||||
```justfile
|
||||
watch-typst doc lang="da":
|
||||
typst watch --input lang={{ lang }} {{ doc }}.typ ./output/{{ doc }}-{{ lang }}.pdf
|
||||
|
||||
watch-pdf doc lang="da":
|
||||
watch-pdf ./output/{{ doc }}-{{ lang }}.pdf
|
||||
|
||||
build doc:
|
||||
typst compile --input lang=en {{ doc }}.typ ./output/{{ doc }}-en.pdf
|
||||
typst compile --input lang=da {{ doc }}.typ ./output/{{ doc }}-da.pdf
|
||||
typst compile --input lang=fo {{ doc }}.typ ./output/{{ doc }}-fo.pdf
|
||||
|
||||
```
|
||||
|
||||
While the machine having the watch-pdf script available in PATH
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
[[ -z "$1" ]] && { echo "ERROR: No PDF filename provided"; exit 1; }
|
||||
PDF_PATH="$1"
|
||||
|
||||
if [[ ! -f "${PDF_PATH}" ]]; then
|
||||
echo "ERROR: ${PDF_PATH} is not a regular file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
command -v evince &> /dev/null || { echo "❌ evince not found. Install: sudo apt-get install evince"; exit 1; }
|
||||
|
||||
echo "=== Reload Watcher Started ==="
|
||||
echo "Monitoring ${PDF_PATH} for writes…"
|
||||
|
||||
while IFS= read -r change_file; do
|
||||
[[ "${change_file}" == "${PDF_PATH}" ]] || continue
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ${PDF_PATH} modified → opening evince"
|
||||
evince "${PDF_PATH}" &
|
||||
done < <(inotifywait -mr --format '%w%f' -e close_write "${PDF_PATH}")
|
||||
|
||||
echo "Watcher stopped."
|
||||
```
|
||||
Reference in New Issue
Block a user