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