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