Track vidthumb, discover-overlay-wait and aurb/aurs scripts

This commit is contained in:
Daniele Fucini
2026-10-10 19:05:48 +02:00
parent 316c3f3b90
commit 2877d5f026
5 changed files with 241 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# aurb / aurs: aur build / aur sync with ccache mounted in the chroot (use with -c)
case "$(basename "$0")" in
aurb) cmd=build ;;
aurs) cmd=sync ;;
*) echo "Invoke as aurb or aurs" >&2; exit 1 ;;
esac
CCACHE_HOST_DIR="$HOME/.cache/ccache"
mkdir -p "$CCACHE_HOST_DIR"
exec aur "$cmd" \
--makepkg-conf "$HOME/.config/aurutils-makepkg.conf" \
--bind-rw "$CCACHE_HOST_DIR" \
"$@"
+1
View File
@@ -0,0 +1 @@
aurb
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
port_up() {
ss -ltn | grep -qE '127\.0\.0\.1:64[67][0-9]'
}
while true; do
while ! port_up; do sleep 2; done
sleep 5
port_up || continue # port vanished again, Discord was still restarting
discover-overlay >> /tmp/discover-overlay.log 2>&1 &
pid=$!
while port_up && kill -0 "$pid" 2>/dev/null; do sleep 3; done
kill "$pid" 2>/dev/null
wait "$pid" 2>/dev/null
sleep 2
done
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
if ! [ -f "$1" ]; then
exit 1
fi
cache="$HOME/.cache/vidthumb"
index="$cache/index.json"
movie="$(realpath "$1")"
mkdir -p "$cache"
if [ -f "$index" ]; then
thumbnail="$(jq -r ". \"$movie\"" <"$index")"
if [[ "$thumbnail" != "null" ]]; then
if [[ ! -f "$cache/$thumbnail" ]]; then
exit 1
fi
echo "$cache/$thumbnail"
exit 0
fi
fi
thumbnail="$(uuidgen).jpg"
if ! ffmpegthumbnailer -i "$movie" -o "$cache/$thumbnail" -s 0 2>/dev/null; then
exit 1
fi
if [[ ! -f "$index" ]]; then
echo "{\"$movie\": \"$thumbnail\"}" >"$index"
fi
json="$(jq -r --arg "$movie" "$thumbnail" ". + {\"$movie\": \"$thumbnail\"}" <"$index")"
echo "$json" >"$index"
echo "$cache/$thumbnail"