X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=clip-up;fp=clip-up;h=dea5f1d23cd52d7bbdb61dba8f95a5c2ffb6bb89;hp=0000000000000000000000000000000000000000;hb=d67edcdca8795a4bca116aa532d02dda246a6f53;hpb=a9e3d60b4254cd5c6216c4b3e7f8cd5cc5107fad diff --git a/clip-up b/clip-up new file mode 100755 index 0000000..dea5f1d --- /dev/null +++ b/clip-up @@ -0,0 +1,25 @@ +#!/bin/bash +set -e; . /usr/local/lib/bash-bear; set +e +cd /a/bin/data/clips/up + +if pgrep mpv; then + pkill mpv + exit 0 +fi + +if [[ ! -s /tmp/last-up ]]; then + find . -type f -printf '%f\n' | shuf > /tmp/last-up +fi +clip=$(head -n1 /tmp/last-up) +tail -n+2 /tmp/last-up | sponge /tmp/last-up + +# clip=$(ls -1 . | \ + # { if [[ -e /tmp/last-up ]]; then +# sed "/^$(cat /tmp/last-up)\$/d" +# else +# cat +# fi ; } | \ + # shuf | head -n1) +# echo $clip >/tmp/last-up + +mpv --profile=a $clip