feat: Add MPV PIP

This commit is contained in:
Abdüssamet Kocak
2026-07-25 09:09:40 +02:00
parent 6bd4d58373
commit 051b7b12f0
Executable
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -euo pipefail
MPV=/opt/homebrew/bin/mpv
if [[ $# -eq 0 ]]; then
echo "Usage: $(basename "$0") <file|url> [file|url ...]" >&2
echo " $(basename "$0") mpv://open?url=<url-encoded target>" >&2
exit 1
fi
TARGETS=()
for arg in "$@"; do
if [[ "$arg" == mpv://* ]]; then
arg=$(python3 -c '
import sys, urllib.parse as u
q = u.parse_qs(u.urlparse(sys.argv[1]).query)
print(q["url"][0])
' "$arg")
fi
TARGETS+=("$arg")
done
"$MPV" --ontop --on-all-workspaces --volume=0 "${TARGETS[@]}" &