From fc0eecc37e57b9b44d372ae50db7ff58ac5e1f9f Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:28:52 +0200 Subject: [PATCH 001/122] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b38cd32d..5cb9e898 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,6 @@ Recommended extras: - `notify-send` - `yt-dlp` -Check for missing dependencies using `mpvc-installer check-reqs`. - ## Installation - [Manual](#manual) @@ -78,7 +76,8 @@ Check for missing dependencies using `mpvc-installer check-reqs`. Installing is just a matter of fetching the scripts either via [Git](#git)/Curl/etc., scripts can be used directly from the repo, the `mpvc-installer` bit is just there for easiness, to fetch & link them into your `BINDIR=~/bin/` that [mpvc-installer](../../blob/master/extras/mpvc-installer) does by default. -The easiest for a onetime [Manual](#manual) install, however for @latest version a [Git](#git) install is recommended. +The easiest for a onetime install is the [Manual](#manual), however for @latest version a [Git](#git) install is recommended. +Check for missing dependencies/requirements using `mpvc-installer check-reqs`. ### Manual @@ -235,6 +234,8 @@ Like any piece of software, mpvc is not perfect: - mpvc depends on shell tools. If your shell is misconfigured or you are using unusual variants of basic UNIX tools, mpvc is not guaranteed to work. However, all effort has been made to make mpvc as POSIX compliant as possible. + Remember to check for missing dependencies/requirements using `mpvc-installer check-reqs`. + Check out the [Issue Tracker](../../issues) for further improvements to be made. From ad3e793a509df47ab1ca66f919ac24fc4b5830db Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:53:26 +0200 Subject: [PATCH 002/122] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f4b4156e..058448c9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -15,5 +15,7 @@ Steps to reproduce the behavior: 1. Run command '...' 2. See error +(Ensure that the issue can be reproduced on a clean install, and that there are no missing deps/reqs using `mpvc-installer check-reqs`) + **Expected behavior** A clear and concise description of what you expected to happen. From 52f9075dc5d9fa62bae1d9f6fa639a899b836c4a Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:19:36 +0200 Subject: [PATCH 003/122] extras: Update extras/mpvc-installer --- extras/mpvc-installer | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extras/mpvc-installer b/extras/mpvc-installer index b5b08422..1d5ef800 100755 --- a/extras/mpvc-installer +++ b/extras/mpvc-installer @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh # # @file mpvc-installer # @version v1.0 @@ -116,6 +116,7 @@ mpvc_uninstall() mpvc_check_requirements() { # attempt at listing packages required by mpvc & extras/ to work + command -v "sh" || echo "$PROGNAME: Error: No sh(1) found. Install to continue." command -v "mpv" || echo "$PROGNAME: Error: No mpv found. Install to continue." command -v "fzf" || echo "$PROGNAME: Error: No fzf found, Install to continue" command -v "awk" || echo "$PROGNAME: Error: No awk found, Install to continue" # gawk ??? From 59490ec4daef9c3818f92f6e197295f6e8be319d Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:20:24 +0200 Subject: [PATCH 004/122] extras: Update extras/mpvc-installer --- extras/mpvc-installer | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/mpvc-installer b/extras/mpvc-installer index 1d5ef800..e2cb5cef 100755 --- a/extras/mpvc-installer +++ b/extras/mpvc-installer @@ -116,8 +116,8 @@ mpvc_uninstall() mpvc_check_requirements() { # attempt at listing packages required by mpvc & extras/ to work - command -v "sh" || echo "$PROGNAME: Error: No sh(1) found. Install to continue." - command -v "mpv" || echo "$PROGNAME: Error: No mpv found. Install to continue." + command -v "sh" || echo "$PROGNAME: Error: No sh found. Install to continue" + command -v "mpv" || echo "$PROGNAME: Error: No mpv found. Install to continue" command -v "fzf" || echo "$PROGNAME: Error: No fzf found, Install to continue" command -v "awk" || echo "$PROGNAME: Error: No awk found, Install to continue" # gawk ??? command -v "sed" || echo "$PROGNAME: Error: No sed found, Install to continue" # gsed ??? From 9011a313faace5ac4dea78604c7e90edb487ecc7 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:20:30 +0200 Subject: [PATCH 005/122] mpvc: Update mpvc --- mpvc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mpvc b/mpvc index ad835d60..2061feac 100755 --- a/mpvc +++ b/mpvc @@ -47,6 +47,7 @@ EOF -L | --loopfile : Loop currently playing file. -m | --mute : Toggle sound. -t | --seek : Increase/decrease playback time relatively, accepts % values. + | --seekrand : Set a random playback time. -T | --time : Set absolute playback time. -x | --speed : Increase/decrease speed relative to the current speed. -X | --speedval : Set absolute speed. @@ -573,6 +574,7 @@ mpvc_appendtracks() { mpvc_get_random() { od -vAn -N2 -tu2 < /dev/urandom; } mpvc_play_random() { mpvc_set_track "$(mpvc_get_random)" "absolute"; } +mpvc_seek_random() { d=$(mpvc_get duration); mpvc_set_time "absolute" "$(( $(mpvc_get_random) % ${d%%.*} ))"; } mpvc_play_now() { mpvc_play_next "$@" @@ -585,7 +587,8 @@ mpvc_play_next() { mpvc_appendtracks "$@" lid_last="$(( $(mpvc_get playlist-count) - 1 ))" lid_next="$(( $(mpvc_get playlist-pos) + 1 ))" - for f in "$@"; do + for f in "$@"; + do mpvc_move_track "$lid_last" "$lid_next" done } @@ -1041,6 +1044,7 @@ main() { # random) MPV doesn't have this control option! # GNU-style options + --seekrand|seekrand) shift; mpvc_seek_random;; -t|--seek|seek) shift; mpvc_set_time "relative" "${1:-}" ;; -T|--time|time) shift; mpvc_set_time "absolute" "${1:-}" ;; -v|--vol) shift; mpvc_add "volume" "${1:-}" ;; From 2894d8daf35499ff338f9a2d8f9274d2a31d73a1 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:11:02 +0200 Subject: [PATCH 006/122] mpvc: Update mpvc --- mpvc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mpvc b/mpvc index 2061feac..36a22bef 100755 --- a/mpvc +++ b/mpvc @@ -481,14 +481,14 @@ mpvc_stash() { apply_current) while read -r line; do case "$line" in - "# $PROGNAME "*) echo "$line";; - "mpvc --mpv") mpvc_mpv;; - "mpvc --wait") mpvc_wait;; - "mpvc mpv") mpvc_mpv;; - "mpvc wait") mpvc_wait;; - "mpvc cmd "*) mpvc_cmd ${line##mpvc cmd };; - "mpvc set "*) mpvc_set ${line##mpvc set } || true;; - "mpvc add "*) mpvc_appendtrack "${line##mpvc add }";; + "# $PROGNAME "*) quietcheck warn "$line";; + "mpvc --mpv") quietcheck mpvc_mpv;; + "mpvc --wait") quietcheck mpvc_wait;; + "mpvc mpv") quietcheck mpvc_mpv;; + "mpvc wait") quietcheck mpvc_wait;; + "mpvc cmd "*) quietcheck mpvc_cmd ${line##mpvc cmd };; + "mpvc set "*) quietcheck mpvc_set ${line##mpvc set } || true;; + "mpvc add "*) quietcheck mpvc_appendtrack "${line##mpvc add }";; esac done ;; @@ -559,7 +559,7 @@ mpvc_appendtrack() { # cache media here if media is found in local storage if [ "$MPVC_LOCAL_CACHE" = "true" ]; then filename=$(echo "$filename" | $PROGDIR/mpvc-fzf -C); fi mpvc_ecmdr "loadfile" "$filename" "append-play" || return 1 - echo "Adding: $(mpvc_curl_cache_title_clean "$filename")" + quietcheck warn "Adding: $(mpvc_curl_cache_title_clean "$filename")" fi } From 937ba236b362d3072d2196ff53a94a7017a9b40c Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:45:41 +0200 Subject: [PATCH 007/122] extras: Update extras/mpvc-web --- extras/mpvc-web | 46 +++++++++++++--------------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/extras/mpvc-web b/extras/mpvc-web index 43fa02f8..2bd1a464 100755 --- a/extras/mpvc-web +++ b/extras/mpvc-web @@ -36,9 +36,8 @@ mpvc_web_defaults() MPVC_WEB_PORT=${MPVC_WEB_PORT:-8000} MPVC_WEB_ROOT=${MPVC_WEB_ROOT:-/tmp/mpvc-web/root} MPVC_WEB_SSL_PORT=${MPVC_WEB_SSL_PORT:-8443} - MPVC_WEB_SSL_PEM=${MPVC_WEB_SSL_PEM:-$MPVC_WEB_ROOT/../stunnel.pem} - MPVC_WEB_SSL_CFG=${MPVC_WEB_SSL_CFG:-$MPVC_WEB_ROOT/../stunnel.cfg} - MPVC_WEB_SSL_PID=${MPVC_WEB_SSL_PID:-$MPVC_WEB_ROOT/../stunnel.pid} + MPVC_WEB_SSL_PEM=${MPVC_WEB_SSL_PEM:-$MPVC_WEB_ROOT/../ssl.pem} + MPVC_WEB_SSL_PID=${MPVC_WEB_SSL_PID:-$MPVC_WEB_ROOT/../ssl.pid} MPVC_WEB_SSL_ENABLE=${MPVC_WEB_SSL_ENABLE:-} MPVC_WEB_SSL_VERIFY=${MPVC_WEB_SSL_VERIFY:-0} MPVC_WEB_ARCHIVE_ENABLE=${MPVC_WEB_ARCHIVE_ENABLE:-} @@ -82,8 +81,8 @@ mpvc_web_config() echo "$PROGNAME: Error: No python3 found, install to continue." exit fi - if ! command -v stunnel >/dev/null; then - echo "$PROGNAME: Warning: No stunnel found, install to support SSL." + if ! command -v socat >/dev/null; then + echo "$PROGNAME: Warning: No socat found, install to support SSL." fi } @@ -461,30 +460,12 @@ mpvc_web_favicon() EOF } -mpvc_web_stunnel_cfg() +mpvc_web_https() { - cat < "$MPVC_WEB_SSL_PID" } mpvc_web_setup() @@ -518,19 +499,18 @@ mpvc_web_setup() mpvc_web_cgi > "$MPVC_WEB_CGI" chmod u+x "$MPVC_WEB_CGI" - # setup https stunnel if requested + # setup https socat if requested if [ -n "${MPVC_WEB_SSL_ENABLE}" ]; then - echo "# $PROGNAME Setup $MPVC_WEB_ROOT stunnel: $MPVC_WEB_HOST:$MPVC_WEB_SSL_PORT" - mpvc_web_stunnel_cfg > "$MPVC_WEB_SSL_CFG" + echo "# $PROGNAME Setup $MPVC_WEB_ROOT socat: $MPVC_WEB_HOST:$MPVC_WEB_SSL_PORT" if [ ! -e "$MPVC_WEB_SSL_PEM" ]; then MPVC_WEB_SSL_SUBJ="/C=CN/ST=ST/O=$PROGNAME/CN=$PROGNAME-$MPVC_WEB_HOSTNAME" openssl req -new -x509 -days 365 -nodes -out "$MPVC_WEB_SSL_PEM" -keyout "$MPVC_WEB_SSL_PEM" -subj "$MPVC_WEB_SSL_SUBJ" openssl pkcs12 -export -passout "pass:" -in "$MPVC_WEB_SSL_PEM" -out "$MPVC_WEB_SSL_PEM.p12" fi - if [ -e "$MPVC_WEB_SSL_PID" ]; then + if [ -s "$MPVC_WEB_SSL_PID" ]; then kill "$(cat "$MPVC_WEB_SSL_PID")" || true fi - stunnel "$MPVC_WEB_SSL_CFG" + mpvc_web_https fi if [ -n "${MPVC_WEB_DEV:-}" ]; then From 7aa7cf59b18ba5e5afac7362fb491038ea2d67cf Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Fri, 11 Oct 2024 19:52:48 +0200 Subject: [PATCH 008/122] docs: Update docs/logbook.html --- docs/logbook.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/logbook.html b/docs/logbook.html index a43fe7de..90409200 100644 --- a/docs/logbook.html +++ b/docs/logbook.html @@ -536,8 +536,8 @@

On the security of mpvc-web, 17 Nov 2023

The solution has been to change the defaults: so now mpvc-web runs by default on localhost, and, a new option: `MPVC_WEB_SSL_ENABLE=1 mpvc-web` -setups a `stunnel(1)` HTTPS connection, this allows to address the HTTPS security part. -Next, to address the authentication part, `stunnel(1)` provides peer +setups a `socat(1)` HTTPS connection, this allows to address the HTTPS security part. +Next, to address the authentication part, `socat(1)` provides peer certificate verification, so using the new option `MPVC_WEB_SSL_ENABLE=1 MPVC_WEB_SSL_VERIFY=2 mpvc-web` only clients that provide a valid peer certificate can connect to mpvc-web.

@@ -557,7 +557,7 @@

On the security of mpvc-web, 17 Nov 2023

  • If additionally, the environment can get attacks from malicious users, then require the use of peer certificates, therefore, limiting access only to those - clients/peers that have present valid `stunnel(1)` certificate with: + clients/peers that have present valid `socat(1)` certificate with: `MPVC_WEB_HOST=0 MPVC_WEB_SSL_ENABLE=1 MPVC_WEB_SSL_VERIFY=2 mpvc-web`
  • From ac92456cd0d1f85ec45f9a6817ff9f17e1f118d7 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:42:37 +0200 Subject: [PATCH 009/122] extras: Update extras/mpvc-web --- extras/mpvc-web | 113 +++++++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 53 deletions(-) diff --git a/extras/mpvc-web b/extras/mpvc-web index 2bd1a464..0117ff27 100755 --- a/extras/mpvc-web +++ b/extras/mpvc-web @@ -462,7 +462,7 @@ EOF mpvc_web_https() { - MPVC_WEB_LISTEN="pf=ip4,bind=$MPVC_WEB_HOST,cert=$MPVC_WEB_SSL_PEM,cafile=$MPVC_WEB_SSL_PEM,verify=$MPVC_WEB_SSL_VERIFY" + MPVC_WEB_LISTEN="bind=$MPVC_WEB_HOST,cert=$MPVC_WEB_SSL_PEM,cafile=$MPVC_WEB_SSL_PEM,verify=$MPVC_WEB_SSL_VERIFY" socat "OPENSSL-LISTEN:$MPVC_WEB_SSL_PORT,$MPVC_WEB_LISTEN,reuseaddr,fork" "TCP:$MPVC_WEB_HOST:$MPVC_WEB_PORT" & #echo "$$" > "$MPVC_WEB_SSL_PID" @@ -531,64 +531,71 @@ mpvc_web() # XXX handle cli commands, rewrite this mess python3 -u -m http.server --cgi --bind "$MPVC_WEB_HOST" "$MPVC_WEB_PORT" "$@" 2>&1 | - awk -v mpvc="$MPVC_WEB_CGI" \ + awk -v mpvcbin="$MPVC_WEB_CGI" \ ' + function mpvcdash(cmd) { system(mpvcbin" "cmd); } + function mpvc(cmd) { mpvcdash("mpvc -q "cmd); } + function httpreq(r) + { + sub("HTTP.*$", "", r); + sub("^.*GET \\/\\?cli=(mpvc-)", "mpvc-", r); + sub("^.*GET \\/\\?cli=(mpvc)\\+", "mpvc ", r); + + gsub("^("mpvcbin") [^a-zA-Z0-9 ]*", "", r); + gsub("\\+", " ", r); + gsub("%22", "\"", r); + gsub("%2B", "+", r); + gsub("%23", "#", r); + gsub("%2F", "/", r); + gsub("%3A", ":", r); + + return r + } + BEGIN { quiet=1 } - /GET \/\?cmd=mpvc%20mpv/ { system(mpvc" mpvc -q mpv") } - /GET \/\?cmd=mpvc%20clear/ { system(mpvc" mpvc -q clear") } - /GET \/\?cmd=mpvc%20kill/ { system(mpvc" mpvc -q kill") } - /GET \/\?cmd=mpvc%20vol%20-5/ { system(mpvc" mpvc -q vol -5") } - /GET \/\?cmd=mpvc%20vol%20\+5/ { system(mpvc" mpvc -q vol +5") } - - /GET \/\?cmd=mpvc%20--mute/ { system(mpvc" mpvc -q --mute") } - /GET \/\?cmd=mpvc%20toggle/ { system(mpvc" mpvc -q toggle") } - /GET \/\?cmd=mpvc%20play/ { system(mpvc" mpvc -q play") } - /GET \/\?cmd=mpvc%20start%200/ { system(mpvc" mpvc -q start 0") } - /GET \/\?cmd=mpvc%20start%20$/ { system(mpvc" mpvc -q start $") } - /GET \/\?cmd=mpvc%20stop/ { system(mpvc" mpvc -q stop") } - /GET \/\?cmd=mpvc%20prev/ { system(mpvc" mpvc -q prev") } - /GET \/\?cmd=mpvc%20next/ { system(mpvc" mpvc -q next") } - /GET \/\?cmd=mpvc%20playrand/ { system(mpvc" mpvc -q playrand") } - - /GET \/\?cmd=mpvc%20shuffle/ { system(mpvc" mpvc -q shuffle") } - /GET \/\?cmd=mpvc%20unshuffle/ { system(mpvc" mpvc -q unshuffle") } - - /GET \/\?cmd=mpvc%20repeat/ { system(mpvc" mpvc -q repeat") } - /GET \/\?cmd=mpvc%20single/ { system(mpvc" mpvc -q single") } - /GET \/\?cmd=mpvc%20replay/ { system(mpvc" mpvc -q replay") } - - /GET \/\?cmd=mpvc%20togglev/ { system(mpvc" mpvc -q togglev") } - /GET \/\?cmd=mpvc%20aspect/ { system(mpvc" mpvc -q aspect") } - /GET \/\?cmd=mpvc%20togglew/ { system(mpvc" mpvc -q togglew") } - /GET \/\?cmd=mpvc%20togglef/ { system(mpvc" mpvc -q togglef") } - /GET \/\?cmd=mpvc%20togglei/ { system(mpvc" mpvc -q togglei") } - - /GET \/\?cmd=mpvc%20cstart/ { system(mpvc" mpvc -q cplay 0") } - /GET \/\?cmd=mpvc%20creplay/ { system(mpvc" mpvc -q chapter-replay") } - /GET \/\?cmd=mpvc%20cloop/ { system(mpvc" mpvc -q chapter-loop") } - /GET \/\?cmd=mpvc%20cprev/ { system(mpvc" mpvc -q chapter-prev") } - /GET \/\?cmd=mpvc%20cnext/ { system(mpvc" mpvc -q chapter-next") } - /GET \/\?cmd=mpvc%20cplayrand/ { system(mpvc" mpvc -q cplayrand") } + /GET \/\?cmd=mpvc%20mpv/ { mpvc("mpv") } + /GET \/\?cmd=mpvc%20clear/ { mpvc("clear") } + /GET \/\?cmd=mpvc%20kill/ { mpvc("kill") } + /GET \/\?cmd=mpvc%20vol%20-5/ { mpvc("vol -5") } + /GET \/\?cmd=mpvc%20vol%20\+5/ { mpvc("vol +5") } + + /GET \/\?cmd=mpvc%20--mute/ { mpvc("--mute") } + /GET \/\?cmd=mpvc%20toggle/ { mpvc("toggle") } + /GET \/\?cmd=mpvc%20play/ { mpvc("play") } + /GET \/\?cmd=mpvc%20start%200/ { mpvc("start 0") } + /GET \/\?cmd=mpvc%20start%20$/ { mpvc("start $") } + /GET \/\?cmd=mpvc%20stop/ { mpvc("stop") } + /GET \/\?cmd=mpvc%20prev/ { mpvc("prev") } + /GET \/\?cmd=mpvc%20next/ { mpvc("next") } + /GET \/\?cmd=mpvc%20playrand/ { mpvc("playrand") } + + /GET \/\?cmd=mpvc%20shuffle/ { mpvc("shuffle") } + /GET \/\?cmd=mpvc%20unshuffle/ { mpvc("unshuffle") } + + /GET \/\?cmd=mpvc%20repeat/ { mpvc("repeat") } + /GET \/\?cmd=mpvc%20single/ { mpvc("single") } + /GET \/\?cmd=mpvc%20replay/ { mpvc("replay") } + + /GET \/\?cmd=mpvc%20togglev/ { mpvc("togglev") } + /GET \/\?cmd=mpvc%20aspect/ { mpvc("aspect") } + /GET \/\?cmd=mpvc%20togglew/ { mpvc("togglew") } + /GET \/\?cmd=mpvc%20togglef/ { mpvc("togglef") } + /GET \/\?cmd=mpvc%20togglei/ { mpvc("togglei") } + + /GET \/\?cmd=mpvc%20cstart/ { mpvc("cplay 0") } + /GET \/\?cmd=mpvc%20creplay/ { mpvc("chapter-replay") } + /GET \/\?cmd=mpvc%20cloop/ { mpvc("chapter-loop") } + /GET \/\?cmd=mpvc%20cprev/ { mpvc("chapter-prev") } + /GET \/\?cmd=mpvc%20cnext/ { mpvc("chapter-next") } + /GET \/\?cmd=mpvc%20cplayrand/ { mpvc("cplayrand") } /GET \/\?cli=mpvc/ { - r=$0; - gsub("HTTP.*$", "", r); - gsub("^.*GET \\/\\?cli=(mpvc-)", mpvc" mpvc-", r); - gsub("^.*GET \\/\\?cli=(mpvc)\\+", mpvc" mpvc ", r); - - if (ENVIRON["MPVC_WEB_DEV"] && match(r, "^"mpvc)) + r=httpreq($0) + if (ENVIRON["MPVC_WEB_DEV"] && match(r, "^mpvc")) { - gsub("^("mpvc") [^a-zA-Z0-9 ]*", mpvc" ", r); - gsub("\\+", " ", r); - gsub("%22", "\"", r); - gsub("%2B", "+", r); - gsub("%23", "#", r); - gsub("%2F", "/", r); - gsub("%3A", ":", r); - - #print(r); - system(r); # XXX + #print(r) + mpvcdash(r) # XXX } } From 875032125328ec743280f150104df66e5a4413c0 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:26:56 +0200 Subject: [PATCH 010/122] extras: Update extras/mpvc-web --- extras/mpvc-web | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/extras/mpvc-web b/extras/mpvc-web index 0117ff27..81ec5887 100755 --- a/extras/mpvc-web +++ b/extras/mpvc-web @@ -533,14 +533,13 @@ mpvc_web() python3 -u -m http.server --cgi --bind "$MPVC_WEB_HOST" "$MPVC_WEB_PORT" "$@" 2>&1 | awk -v mpvcbin="$MPVC_WEB_CGI" \ ' - function mpvcdash(cmd) { system(mpvcbin" "cmd); } - function mpvc(cmd) { mpvcdash("mpvc -q "cmd); } + function mpvcsys(cmd) { system(mpvcbin" "cmd); } + function mpvc(cmd) { mpvcsys("mpvc -q "cmd); } function httpreq(r) { sub("HTTP.*$", "", r); sub("^.*GET \\/\\?cli=(mpvc-)", "mpvc-", r); sub("^.*GET \\/\\?cli=(mpvc)\\+", "mpvc ", r); - gsub("^("mpvcbin") [^a-zA-Z0-9 ]*", "", r); gsub("\\+", " ", r); gsub("%22", "\"", r); @@ -548,7 +547,6 @@ mpvc_web() gsub("%23", "#", r); gsub("%2F", "/", r); gsub("%3A", ":", r); - return r } @@ -595,7 +593,7 @@ mpvc_web() if (ENVIRON["MPVC_WEB_DEV"] && match(r, "^mpvc")) { #print(r) - mpvcdash(r) # XXX + mpvcsys(r) # XXX } } From 70f035a58a636ed579603c47939c0ce479b87b26 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:48:27 +0200 Subject: [PATCH 011/122] mpvc: Update mpvc --- mpvc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 36a22bef..650c9494 100755 --- a/mpvc +++ b/mpvc @@ -201,13 +201,18 @@ mpvc_isotime() { TZ=UTC date -u +"%Y-%m-%dT%H:%M:%SZ"; } ## Retrieval Functions ######################################################## +mpvc_curl() +{ + curl -A 'Mozilla/5.0' "$@" +} + mpvc_curl_cache() { k=$2 v="$( awk -F'\t' -v k="$k" '{ if ($1 == k) {print $2; exit} }' "$MPVC_CURL_CACHE" )" if [ "${#v}" -eq 0 ]; then - v=$(curl "$@") + v=$(mpvc_curl "$@") o=$(cat "$MPVC_CURL_CACHE") # append at the top in 2023 :-) (echo "$k $v"; echo "$o") > "$MPVC_CURL_CACHE" fi From 0e6ef380ed542480d843d10fc40c21b28be1e089 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Wed, 16 Oct 2024 05:32:34 +0200 Subject: [PATCH 012/122] docs: Update docs/logbook.html --- docs/logbook.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/logbook.html b/docs/logbook.html index 90409200..f013b9b4 100644 --- a/docs/logbook.html +++ b/docs/logbook.html @@ -121,7 +121,7 @@

    On load/save functionality, 18 Nov 2022

    On persistent mpv startup, 20 Nov 2022

    -One particular feature where improvement could be done mpvc -a audio.opus, when mpv finishes playing audio.opus, mpv terminates, and, the current playlist is lost. This happens as mpv is started with --idle=once. A solution for this is to start mpv separately with --idle=yes. A shortcut for this is to run `mpvc --mpv` that does exactly this, after this the mpv instance can be manipulated with mpvc, and does not terminate once mpv finishes playing. +One particular feature where improvement could be done is mpvc -a audio.opus, when mpv finishes playing audio.opus, mpv terminates, and, the current playlist is lost. This happens as mpv is started with --idle=once. A solution for this is to start mpv separately with --idle=yes. A shortcut for this is to run mpvc --mpv that does exactly this, after this the mpv instance can be manipulated with mpvc, and does not terminate once mpv finishes playing.

    On a minimal mpvc-tui, 03 Dec 2022

    @@ -604,10 +604,11 @@

    On MPRIS support, 14 Feb 2024

    Check mpv-mpris for docs/setup, below is a quick setup: -

    -mkdir -p ~/.config/mpv/scripts
    +
    +mkdir -p ~/.config/mpv/scripts;
    +
     curl -fsSL -o ~/.config/mpv/scripts/mpris.so https://github.com/hoyon/mpv-mpris/releases/download/1.0/mpris.so
    -
    + Then, start a new instance of mpv player that loads `mpris.so`
    @@ -644,9 +645,10 @@

    Introducing mpvc-chapter: helper for managing chapters

    Introducing mpvc-osd: interfacing mpvc with a 4x20 USB LCD, 5 May 2024

    While mpvc was playing `The Number 4` from Khruangbin's EP `The Infamous Bill` decided it would be fun to interface mpvc with a USB LCD on the Raspberry PI that acts as a jukebox, so each time a track starts output what's playing now for some seconds, and then poweroff the LCD. Turned out nice and easy by using mpvc-tui -S scrobbling code, and masaging the output to pipe it to the USB LCD for presentation. For the record the output from mpvc-tui is: -

    +
         mpvc-tui -S 'echo $(date +"T%H:%M") $(mpvc -f "[%status%] #%position%/%playlistlength% %time% %artist% - %title% - %path%")' 'false'
    -
    +. + And this is how it looks:

    mpvc-osd usblcd From 39918b10ee0821813fc74ecf54525cdd56caca58 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 24 Oct 2024 07:08:59 +0200 Subject: [PATCH 013/122] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5cb9e898..de12e42e 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Recommended extras: - [Gentoo](#gentoo-mpvc) - [Nix](#nix-mpvc) -Installing is just a matter of fetching the scripts either via [Git](#git)/Curl/etc., scripts can be used directly from the repo, the `mpvc-installer` bit is just there for easiness, to fetch & link them into your `BINDIR=~/bin/` that [mpvc-installer](../../blob/master/extras/mpvc-installer) does by default. +Installing is just a matter of fetching the scripts either via [Git](#git)/Curl/etc., scripts can be used directly from the repo, the `mpvc-installer` bit is just there for easiness, to fetch & link them into your `BINDIR=~/bin/` that [mpvc-installer](../../blob/master/extras/mpvc-installer) does by default. The easiest for a onetime install is the [Manual](#manual), however for @latest version a [Git](#git) install is recommended. Check for missing dependencies/requirements using `mpvc-installer check-reqs`. @@ -98,8 +98,6 @@ This does git clone, and symlinks the mpvc scripts to `BINDIR` (default `~/bin`) (cd mpvc; extras/mpvc-installer link-user) (cd mpvc; extras/mpvc-installer check-reqs) - # use mpvc-fzf to search and play youtube media - mpvc-fzf -p 'kupla mirage' # use mpvc to add/load/save media files or online YT URLs mpvc add /path/to/your/*.mp3 # or your URLs find . -type f -name | mpvc load @@ -110,6 +108,10 @@ This does git clone, and symlinks the mpvc scripts to `BINDIR` (default `~/bin`) mpvc stash push current mpvc stash apply current + # use mpvc-fzf to manage mpvc stash (see mpvc-fzf -h for more) + mpvc-fzf -a + # use mpvc-fzf to search and play youtube media + mpvc-fzf -p 'kupla mirage' # use mpvc-fzf to manage the playlist mpvc-fzf -f # use mpvc-tui to start the tui + desktop notifications From 879820be4004f19ac336bf7c03f02ce888df092a Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 26 Oct 2024 05:45:55 +0200 Subject: [PATCH 014/122] extras: Update extras/mpvc-tui --- extras/mpvc-tui | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index 9dbc13d1..f8cb195a 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -43,9 +43,9 @@ mpvctui_defaults() # config defaults NO_COLOR="${NO_COLOR:-}" - MPVC_TUI_COLOR0="$MPVC_TUI_CGREENL" - MPVC_TUI_COLOR1="$MPVC_TUI_CCYAN" - MPVC_TUI_COLOR2="$MPVC_TUI_CYELLOW" + MPVC_TUI_COLOR0="${MPVC_TUI_COLOR0:-$MPVC_TUI_CGREENL}" + MPVC_TUI_COLOR1="${MPVC_TUI_COLOR1:-$MPVC_TUI_CCYAN}" + MPVC_TUI_COLOR2="${MPVC_TUI_COLOR2:-$MPVC_TUI_CYELLOW}" MPVC_TUI_UPDATEC=${MPVC_TUI_UPDATEC:-2} MPVC_TUI_CLEARC=${MPVC_TUI_CLEARC:-4} @@ -53,6 +53,9 @@ mpvctui_defaults() MPVC_TUI_TIPS=${MPVC_TUI_TIPS:-true} MPVC_TUI_TERM=${MPVC_TUI_TERM:-xterm} MPVC_TUI_SHELL=$(readlink -f /proc/$$/exe) + + MPVC_TUI_STATUS_CMD="${MPVC_TUI_STATUS_CMD:-status}" + MPVC_TUI_PLAYLIST_CMD="${MPVC_TUI_PLAYLIST_CMD:-playlist}" export MPVC_TUI_CLINE=${MPVC_TUI_CLINE:-11} } @@ -136,9 +139,9 @@ mpvctui_watcher() { mpvctui_header0 "${MPVC_TUI_HEADER0}$(mpvctui_tips)" mpvctui_header1 "Status" - mpvc status + mpvc "${MPVC_TUI_STATUS_CMD}" mpvctui_header1 "Playlist" - mpvc playlist + mpvc "${MPVC_TUI_PLAYLIST_CMD}" mpvctui_header1 "Prompt" } From 2391cb7e3596777aa74842438ea14752f440e994 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 26 Oct 2024 05:48:10 +0200 Subject: [PATCH 015/122] docs: Update docs/logbook.html --- docs/logbook.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/logbook.html b/docs/logbook.html index f013b9b4..efb35b6e 100644 --- a/docs/logbook.html +++ b/docs/logbook.html @@ -379,7 +379,7 @@

    Introducing mpvc-web: a mpvc-tui like hack for the web As a minor thing I've started aliasing mpvc commands that I use frequently to their "m" counterparts in bash, not perfect, but handy enough, and saves some typing:
     $ grep mpvc ~/.bashrc
    -    alias m="mpvc"
    +    alias m="mpvc lowfi"
         alias mh="alias | grep mpvc"
         alias mi="mpvc -i"
         alias mI="mpvc -I"
    
    From 1e4030e93d89e6c89f2dbb1b9f6daf70f8c3390b Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sat, 26 Oct 2024 05:50:28 +0200
    Subject: [PATCH 016/122] mpvc: Update mpvc
    
    ---
     mpvc | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/mpvc b/mpvc
    index 650c9494..706a40de 100755
    --- a/mpvc
    +++ b/mpvc
    @@ -874,7 +874,11 @@ mpvc_print_status() {
             }
             '
         )
    -    mpvc_cmd "expand-text" "${F}" | awk '{gsub(" \\\\r","\n");print}'
    +    mpvc_cmd "expand-text" "${F}" |
    +        awk '{
    +                # trim/replace times: 00:01:59 -> 01:59
    +                gsub(" \\\\r","\n"); gsub(" 00:", " "); gsub("/00:", "/"); print
    +        }'
     }
     
     mpvc_print_status_final() {
    @@ -1137,6 +1141,7 @@ main() {
                 --delay|delay)                   mpvc_delay;;
                 --wait|wait)                     mpvc_wait;;
                 --tac|tac)                       mpvc_tac; exit 0;;
    +            --lowfi|lowfi)                   MPVC_FORMATSTRING='[%status%] β–· %title% @ %time%/%length% #%position%/%playlistlength% 🎧';;
     
                 --ttysize|ttysize)               mpvc_tty_size; QUIETFLAG=true;;
                 --ttycols|ttycols)               mpvc_tty_cols; QUIETFLAG=true;;
    
    From 87c09baedafa70ec42a55858971eb631060b4b31 Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sat, 26 Oct 2024 09:45:15 +0200
    Subject: [PATCH 017/122] extras: Update extras/mpvc-fzf
    
    ---
     extras/mpvc-fzf | 11 ++++++++---
     1 file changed, 8 insertions(+), 3 deletions(-)
    
    diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf
    index d731063a..8ef31074 100755
    --- a/extras/mpvc-fzf
    +++ b/extras/mpvc-fzf
    @@ -328,15 +328,20 @@ mpvcfzf_urlget()
     {
         url=${1:-https://localhost:8443/ytdl-archive/}
         mpvcfzf_curl "$url" |
    -        awk '/.*<\/a>/ { h=$0;sub("^.*href=\"","",h);sub("\".*$","",h);print h }'
    +        awk -v url="$url" '
    +            /.*<\/a>/ {
    +                href=$0; sub("^.*href=\"", "", href)
    +                sub("\".*$","",href)
    +                print (href !~ url) ? url"/"href : href
    +            }
    +        '
     }
     
     mpvcfzf_urlbrowser()
     {
         url=${1:-https://localhost:8443/ytdl-archive/}
         mpvcfzf_urlget "$url" |
    -        mpvcfzf_preview --prompt="(urlbrowse) " |
    -            awk -v url="$url" '{ print url$0 }'
    +        mpvcfzf_preview --prompt="(urlbrowse) "
     }
     
     mpvcfzf_equalizer()
    
    From 3fe25672bdbf4bda6968927e9e14b8df6a977c51 Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sat, 26 Oct 2024 09:47:16 +0200
    Subject: [PATCH 018/122] Update README.md
    
    ---
     README.md | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/README.md b/README.md
    index de12e42e..c3de5168 100644
    --- a/README.md
    +++ b/README.md
    @@ -112,6 +112,8 @@ This does git clone, and symlinks the mpvc scripts to `BINDIR` (default `~/bin`)
      mpvc-fzf -a
      # use mpvc-fzf to search and play youtube media
      mpvc-fzf -p 'kupla mirage'
    + # use mpvc-fzf to browse lofi girl uploads and play music
    + mpvc-fzf -b https://lofigirl.com/wp-content/uploads/2023/06
      # use mpvc-fzf to manage the playlist
      mpvc-fzf -f
      # use mpvc-tui to start the tui + desktop notifications
    
    From 28f2280a90105d970fc39e1bb71a94820b7a1945 Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sat, 26 Oct 2024 10:41:59 +0200
    Subject: [PATCH 019/122] extras: Update extras/mpvc-fzf
    
    ---
     extras/mpvc-fzf | 9 ++++++---
     1 file changed, 6 insertions(+), 3 deletions(-)
    
    diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf
    index 8ef31074..bd6db770 100755
    --- a/extras/mpvc-fzf
    +++ b/extras/mpvc-fzf
    @@ -268,6 +268,8 @@ mpvcfzf_preview()
             --bind='ctrl-t:execute-silent(mpvc add {+1} &)' \
             --bind='ctrl-s:execute(mpvc-fzf -c)' \
             --bind='ctrl-x:execute(mpvc-fzf -f {q})' \
    +        --bind='ctrl-y:execute(mpvc-fzf -b {+1})' \
    +        --bind='ctrl-u:execute(mpvc-fzf -b {+1})' \
             --bind='ctrl-v:execute(mpvc-fzf -p {q})' \
             --bind='ctrl-\:execute(mpvc-fzf -l)' \
             \
    @@ -330,9 +332,10 @@ mpvcfzf_urlget()
         mpvcfzf_curl "$url" |
             awk -v url="$url" '
                 /.*<\/a>/ {
    -                href=$0; sub("^.*href=\"", "", href)
    -                sub("\".*$","",href)
    -                print (href !~ url) ? url"/"href : href
    +                match(url, "https?://[^/]+/", host);
    +                href=$0; sub("^.*href=\"", "", href) sub("\".*$", "", href)
    +                if (href ~ "^/") href = host[0]"/"href
    +                print (href !~ host[0]) ? url"/"href : href
                 }
             '
     }
    
    From bd1cc2580f2d924b08cc155009ce3596c64791a6 Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sat, 26 Oct 2024 11:24:48 +0200
    Subject: [PATCH 020/122] Update mpvc
    
    ---
     mpvc | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/mpvc b/mpvc
    index 706a40de..4012dade 100755
    --- a/mpvc
    +++ b/mpvc
    @@ -157,6 +157,7 @@ mpvc_defaults()
         QUIETFLAG="${QUIETFLAG:-}"
         MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}"
         MPVC_FORMATSTRING="${MPVC_FORMATSTRING:-}"
    +    MPVC_FORMATSTRING_LOFI=${MPVC_FORMATSTRING_LOFI:-'[%status%] β–· %title% @ %time%/%length% #%position%/%playlistlength% (%volume%%%) 🎧'}
     
         # print default status of mpv instance
         if [ -z "$MPVC_FORMATSTRING" ]; then
    @@ -1007,7 +1008,7 @@ main() {
         mpvc_config
         arg1=${1:-}
         case "$arg1" in
    -    ytquery|ytqueryjson|--tac|tac) ;;
    +    ytquery|ytqueryjson|--tac|tac|--lowfi|lowfi) ;;
         -k|--kill|kill|-K|--killall|killall) ;;
         -c|--crop|crop|-C|--clear|clear|cmd|sockcmd|socklist|--socklist) ;;
         -a|add|append|-A|load|--load|playnext|--playnext|-n|playnow|--playnow|mpv|--mpv|stash|--stash|--toggle|toggle|-q|--quiet) ;;
    @@ -1141,7 +1142,7 @@ main() {
                 --delay|delay)                   mpvc_delay;;
                 --wait|wait)                     mpvc_wait;;
                 --tac|tac)                       mpvc_tac; exit 0;;
    -            --lowfi|lowfi)                   MPVC_FORMATSTRING='[%status%] β–· %title% @ %time%/%length% #%position%/%playlistlength% 🎧';;
    +            --lowfi|lowfi)                   MPVC_FORMATSTRING="$MPVC_FORMATSTRING_LOFI" ;;
     
                 --ttysize|ttysize)               mpvc_tty_size; QUIETFLAG=true;;
                 --ttycols|ttycols)               mpvc_tty_cols; QUIETFLAG=true;;
    
    From 243fdb9e1bbd04bb1e4243b7f9284dfb01f89c9f Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sat, 26 Oct 2024 11:24:48 +0200
    Subject: [PATCH 021/122] Update mpvc
    
    ---
     mpvc | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/mpvc b/mpvc
    index 4012dade..03623f84 100755
    --- a/mpvc
    +++ b/mpvc
    @@ -157,7 +157,7 @@ mpvc_defaults()
         QUIETFLAG="${QUIETFLAG:-}"
         MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}"
         MPVC_FORMATSTRING="${MPVC_FORMATSTRING:-}"
    -    MPVC_FORMATSTRING_LOFI=${MPVC_FORMATSTRING_LOFI:-'[%status%] β–· %title% @ %time%/%length% #%position%/%playlistlength% (%volume%%%) 🎧'}
    +    MPVC_FORMATSTRING_LOFI=${MPVC_FORMATSTRING_LOFI:-'[%status%] β–· %title% 🎢 %time%/%length% #%position%/%playlistlength% πŸ”Š%volume%%% 🎧'}
     
         # print default status of mpv instance
         if [ -z "$MPVC_FORMATSTRING" ]; then
    
    From 6698e61db3447cb28d5f0714e7a337a29d54d93b Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sat, 26 Oct 2024 17:45:40 +0200
    Subject: [PATCH 022/122] Update mpvc
    
    ---
     mpvc | 21 ++++++++++++---------
     1 file changed, 12 insertions(+), 9 deletions(-)
    
    diff --git a/mpvc b/mpvc
    index 03623f84..62d49d94 100755
    --- a/mpvc
    +++ b/mpvc
    @@ -156,12 +156,12 @@ mpvc_defaults()
         IMAGEFLAG="${IMAGEFLAG:-}"
         QUIETFLAG="${QUIETFLAG:-}"
         MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}"
    -    MPVC_FORMATSTRING="${MPVC_FORMATSTRING:-}"
    -    MPVC_FORMATSTRING_LOFI=${MPVC_FORMATSTRING_LOFI:-'[%status%] β–· %title% 🎢 %time%/%length% #%position%/%playlistlength% πŸ”Š%volume%%% 🎧'}
    +    MPVC_FMTSTR="${MPVC_FMTSTR:-}"
    +    MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% 🎧'}
     
         # print default status of mpv instance
    -    if [ -z "$MPVC_FORMATSTRING" ]; then
    -        MPVC_FORMATSTRING="\
    +    if [ -z "$MPVC_FMTSTR" ]; then
    +        MPVC_FMTSTR="\
     %artist% - %title% \r\
     [%status%] #%position%/%playlistlength% %time%/%length% (%percentage%%%) \r\
     vol:%volume%%% mute:%mute% repeat:%repeat% single:%single% \r\
    @@ -845,15 +845,18 @@ mpvc_chapter_search_play()
     
     ## Formatting and Printing Functions ##########################################
     
    -# formats and prints according to $MPVC_FORMATSTRING
    +# formats and prints according to $MPVC_FMTSTR
     mpvc_print_status() {
         # not that nice, in fact way more ugly, but also way faster
    -    F=$(echo "$MPVC_FORMATSTRING" |
    +    F=$(echo "$MPVC_FMTSTR" |
             awk '
             {
                 split("year genre album icy-title comment volume volume-max mute path height width playback-time ab-loop-[ab] speed force-window video screen aspect idle fullscreen chapter chapters =chapter", RE)
                 for (i in RE) { re=RE[i]; gsub("%"re"%", "${"re":NA}"); }
     
    +            gsub("%statuslofi%", "${?pause==yes:⏸️}${?pause==no:β–·}${!pause:NA}");
    +            gsub("%mutelofi%", "${?mute==yes:πŸ”‡}${?mute==no:πŸ”Š}${!mute:NA}");
    +
                 gsub("%status%", "${?pause==yes:paused}${?pause==no:play}${!pause:NA}");
                 gsub("%title%", "${media-title}")
                 gsub("%artist%", "${?metadata/by-key/artist:${metadata/by-key/artist}}${!metadata/by-key/artist:NA}")
    @@ -1142,14 +1145,14 @@ main() {
                 --delay|delay)                   mpvc_delay;;
                 --wait|wait)                     mpvc_wait;;
                 --tac|tac)                       mpvc_tac; exit 0;;
    -            --lowfi|lowfi)                   MPVC_FORMATSTRING="$MPVC_FORMATSTRING_LOFI" ;;
    +            --lowfi|lowfi)                   MPVC_FMTSTR="$MPVC_FMTSTR_LOFI" ;;
     
                 --ttysize|ttysize)               mpvc_tty_size; QUIETFLAG=true;;
                 --ttycols|ttycols)               mpvc_tty_cols; QUIETFLAG=true;;
                 --ttylines|ttylines)             mpvc_tty_lines; QUIETFLAG=true;;
     
                 # global argument parsing
    -            -f|--format)                     shift; MPVC_FORMATSTRING="${1:-}"       ;;
    +            -f|--format)                     shift; MPVC_FMTSTR="${1:-}"       ;;
                 -S|--socket)                     shift; mpvc_handle_socket "${1:-}";;
                 -Q|--vid=no)                     MPVOPTIONS="$MPVOPTIONS --vid=no"; ;;
                 --image)                         IMAGEFLAG=true;                ;;
    @@ -1164,7 +1167,7 @@ main() {
             esac
             if [ $# -ge 1 ]; then shift; fi
         done
    -    # produce format strings last
    +    # output mpvc status last
         quietcheck mpvc_print_status_final
     }
     
    
    From 124c0289d57e766d22bbab67eef29e69ca2a3755 Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sat, 26 Oct 2024 20:43:33 +0200
    Subject: [PATCH 023/122] Update mpvc
    
    ---
     mpvc | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/mpvc b/mpvc
    index 62d49d94..8c35186d 100755
    --- a/mpvc
    +++ b/mpvc
    @@ -157,7 +157,7 @@ mpvc_defaults()
         QUIETFLAG="${QUIETFLAG:-}"
         MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}"
         MPVC_FMTSTR="${MPVC_FMTSTR:-}"
    -    MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% 🎧'}
    +    MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi% 🎧'}
     
         # print default status of mpv instance
         if [ -z "$MPVC_FMTSTR" ]; then
    @@ -856,6 +856,8 @@ mpvc_print_status() {
     
                 gsub("%statuslofi%", "${?pause==yes:⏸️}${?pause==no:β–·}${!pause:NA}");
                 gsub("%mutelofi%", "${?mute==yes:πŸ”‡}${?mute==no:πŸ”Š}${!mute:NA}");
    +            gsub("%singlelofi%", "${?loop-file==inf:πŸ”}${?loop-file==no:πŸ”‚}${!loop-file:NA}")
    +            gsub("%repeatlofi%", "${?loop-playlist==inf:πŸ”„}${?loop-playlist==no:πŸ”ƒ}${!loop-playlist:NA}")
     
                 gsub("%status%", "${?pause==yes:paused}${?pause==no:play}${!pause:NA}");
                 gsub("%title%", "${media-title}")
    
    From 9961961dde4f018f3d08b9dd799aadc832dbf5d6 Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sun, 27 Oct 2024 08:46:26 +0100
    Subject: [PATCH 024/122] Update README.md
    
    ---
     README.md | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index c3de5168..aab91a59 100644
    --- a/README.md
    +++ b/README.md
    @@ -112,7 +112,7 @@ This does git clone, and symlinks the mpvc scripts to `BINDIR` (default `~/bin`)
      mpvc-fzf -a
      # use mpvc-fzf to search and play youtube media
      mpvc-fzf -p 'kupla mirage'
    - # use mpvc-fzf to browse lofi girl uploads and play music
    + # use mpvc-fzf to browse & play lofi girl music
      mpvc-fzf -b https://lofigirl.com/wp-content/uploads/2023/06
      # use mpvc-fzf to manage the playlist
      mpvc-fzf -f
    
    From bcbdc604e2bc75a9a8c67484e9f02d3f01b25dd4 Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sun, 27 Oct 2024 08:49:21 +0100
    Subject: [PATCH 025/122] Update README.md
    
    ---
     README.md | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/README.md b/README.md
    index aab91a59..ec280a4b 100644
    --- a/README.md
    +++ b/README.md
    @@ -82,7 +82,7 @@ Check for missing dependencies/requirements using `mpvc-installer check-reqs`.
     ### Manual
     
     ```console
    -curl -fsSL -O https://github.com/lwilletts/mpvc/raw/master/extras/mpvc-installer \
    +curl -LO https://github.com/lwilletts/mpvc/raw/master/extras/mpvc-installer \
       && BINDIR=$HOME/bin sh ./mpvc-installer fetch-user
     ```
     
    
    From 9c460258ed58bb9836735981523e0ec5f5f81b4b Mon Sep 17 00:00:00 2001
    From: gmt4 <791491+gmt4@users.noreply.github.com>
    Date: Sun, 27 Oct 2024 17:45:17 +0100
    Subject: [PATCH 026/122] docs: Update logbook.html
    
    ---
     docs/logbook.html | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/docs/logbook.html b/docs/logbook.html
    index efb35b6e..3f5964ae 100644
    --- a/docs/logbook.html
    +++ b/docs/logbook.html
    @@ -359,6 +359,7 @@ 

    On applying ffmpeg AV filters using the MPV JSON IPC, mpvc cmdr af toggle "@apulsator:lavfi=[apulsator]" mpvc cmdr af toggle "@aphaser:lavfi=[aphaser]" mpvc cmdr af toggle "@aecho:lavfi=[aecho=in_gain=0.9:out_gain=0.9:delays=1:decays=0.9]" +mpvc cmdr af toggle "@lofi:lavfi=[ladspa=cmt:lofi:controls=c0=80|c1=20|c2=9000]" # Some vf filters mpvc cmdr vf toggle "@life:lavfi=[life]" From 3ab9d0c4a1a4487d33369e16ad4084b823a02f38 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 27 Oct 2024 19:38:58 +0100 Subject: [PATCH 027/122] extras: Update extras/mpvc-fzf --- extras/mpvc-fzf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf index bd6db770..68cc2f36 100755 --- a/extras/mpvc-fzf +++ b/extras/mpvc-fzf @@ -478,6 +478,7 @@ mpvcfzf_usage() echo " -x|launch : Starts $PROGNAME in a new $MPVC_TERM (config \$MPVC_TERM) [combine -x with other opts]" echo " -v|version : Return the $PROGNAME version." echo " now : Return a shareable URL to the "now listening" playlist" + echo " lofi : Search & play Lo-Fi channels" echo " somafm : Search & play SomaFM channels" echo " radioapi : Search & play Radio-Browser API channels" echo "*tips: If unsure about where to begin, start: $PROGNAME -p 'kupla mirage'" @@ -531,6 +532,7 @@ main() -v|version) shift; mpvcfzf_version; return ;; now) shift; mpvcfzf_now; return ;; + lofi) shift; mpvcfzf_urlbrowser "https://lofigirl.com/wp-content/uploads/2023/06/" ;; somafm) shift; mpvcfzf_somafm "${1:-}"; return ;; radioapi) shift; mpvcfzf_radioapi "${1:-}"; return ;; #*) shift; mpvcfzf_usage; return ;; From 48f18559fedcc4a6aa192c6a3ff4c904a8c8fd23 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 27 Oct 2024 19:50:50 +0100 Subject: [PATCH 028/122] extras: Update extras/mpvc-web --- extras/mpvc-web | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extras/mpvc-web b/extras/mpvc-web index 81ec5887..e94c4892 100755 --- a/extras/mpvc-web +++ b/extras/mpvc-web @@ -149,6 +149,12 @@ EOF mpvc_web_index_js() { cat <t8 cycle rst + [ From 45f7e81dc82554affd1c56513547a0313423eb87 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 27 Oct 2024 20:58:45 +0100 Subject: [PATCH 029/122] docs: Update docs/logbook.html --- docs/logbook.html | 49 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/docs/logbook.html b/docs/logbook.html index 3f5964ae..0b18bb0f 100644 --- a/docs/logbook.html +++ b/docs/logbook.html @@ -57,10 +57,12 @@

    Contents

    Logbook Entries
    @@ -324,7 +331,7 @@

    Introducing mpvc-equalizer: a basic mpv equalizer for

    On applying ffmpeg AV filters using the MPV JSON IPC, 2 June 2023

    -Continuing with the topic of the previous post about mpvc-equalizer, one reason for starting mpvc, was to ease was to managing audio from the CLI. In that sense mpv integrates well with ffmpeg to apply AV filters. However you've to, either start mpv specifying the ffmpeg cli flags for the AV-filters, or add keyboard shortcuts into the input.conf to be triggedred during runtime. +Continuing with the topic of the previous post about mpvc-equalizer, one reason for starting mpvc, was to ease was to managing audio from the CLI. In that sense mpv integrates well with ffmpeg to apply AV filters (##https://ffmpeg.org/ffmpeg-filters.html"). However you've to, either start mpv specifying the ffmpeg cli flags for the AV-filters, or add keyboard shortcuts into the input.conf to be triggedred during runtime.

    @@ -367,6 +374,12 @@

    On applying ffmpeg AV filters using the MPV JSON IPC, mpvc cmdr vf toggle "@showwaves:lavfi=[showwaves]" mpvc cmdr vf toggle "@showspectrum:lavfi=[showspectrum]" mpvc cmdr vf toggle "@avectorscope:lavfi=[avectorscope]" + +mpvc cmdr vf toggle "@mirrorbottom:lavfi=[[vid1]split[main][tmp];[tmp]crop=iw:ih/2:0:ih/2,vflip[flip];[main][flip]overlay[vo]]" +mpvc cmdr vf toggle "@mirrorleft:lavfi=[[vid1]split[main][tmp];[tmp]crop=iw/2:ih:0:0,hflip[flip];[main][flip]overlay=W/2[vo]]" +mpvc cmdr vf toggle "@mirrorright:lavfi=[[vid1]split[main][tmp];[tmp]crop=iw/2:ih:iw/2:0,hflip[flip];[main][flip]overlay[vo]]" +mpvc cmdr vf toggle "@hstack:lavfi=[[vid1]split[v1][v2];[v1][v2]hstack[t]]" +mpvc cmdr vf toggle "@vstack:lavfi=[[vid1]split[v1][v2];[v1][v2]vstack[t]]"

    @@ -691,17 +704,47 @@

    Some notes on my current mpvc setup, 4 July 2024

    ssh -X $USER@$HOST x2x -west -to :0 # be sure to read x2x(1) +

    On mpvc lowfi and mpvc-fzf URL browser, 26 October 2024

    +

    +Recently landed mpvc lowfi which features a minimal mpvc status that leverages emojis to represent a one-line compressed playing status (aliased to m="mpvc lowfi" above #logbook-20230721): +

    +
    +[play] β–· Polaris 🎢 02:35/04:50 #3/33 πŸ”Š60% πŸ”‚ πŸ”„ 🎧
    +
    +
    +This goes hand in hand with the hability to browse HTTP server listings and add music as in: +
    +
    +% mpvc-fzf -b https://lofigirl.com/wp-content/uploads/2023/05
    +Adding https://lofigirl.com/wp-content/uploads/2023/05/6.Downtown-Binary-_-The-Present-Sound-Polaris.mp3
    +[play] β–· Polaris 🎢 02:35/04:50 #3/33 πŸ”Š60% πŸ”‚ πŸ”„ 🎧
    +
    +
    +The mpvc-fzf -b [URL] browser works as follows: + + + +The above ctrl+[tyu] shortcuts for mpvc-fzf work as well for local, remote, and other media URLs. +

    +

    The End

    + +Return to the Start +

    - Last-Modified: Thursday, 4 July 2024 by gmt4 + πŸ“… Sat, 26 Oct 2024 by gmt4 - Powered by #HTML 🧑 πŸ’š πŸ’™ + ⚑ PoweredBy #HTML

    From 4686ed48a2ecf1aa8cbe2007b852a99b94417889 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 06:04:31 +0100 Subject: [PATCH 030/122] extras: Update extras/mpvc-fzf --- extras/mpvc-fzf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf index 68cc2f36..64f8fbba 100755 --- a/extras/mpvc-fzf +++ b/extras/mpvc-fzf @@ -264,14 +264,15 @@ mpvcfzf_preview() \ --layout=reverse \ --header="$PROGNAME help: $MPVC_FZF_BIND_HELP" \ - --bind='ctrl-space:execute-silent(mpvc toggle &)' \ - --bind='ctrl-t:execute-silent(mpvc add {+1} &)' \ + --bind='ctrl-a:toggle-all' \ --bind='ctrl-s:execute(mpvc-fzf -c)' \ --bind='ctrl-x:execute(mpvc-fzf -f {q})' \ --bind='ctrl-y:execute(mpvc-fzf -b {+1})' \ --bind='ctrl-u:execute(mpvc-fzf -b {+1})' \ --bind='ctrl-v:execute(mpvc-fzf -p {q})' \ --bind='ctrl-\:execute(mpvc-fzf -l)' \ + --bind='ctrl-t:execute-silent(mpvc add {+1} &)' \ + --bind='ctrl-space:execute-silent(mpvc toggle &)' \ \ --preview-window='up:5' \ --preview="mpvc" \ @@ -532,7 +533,7 @@ main() -v|version) shift; mpvcfzf_version; return ;; now) shift; mpvcfzf_now; return ;; - lofi) shift; mpvcfzf_urlbrowser "https://lofigirl.com/wp-content/uploads/2023/06/" ;; + lofi) shift; mpvcfzf_urlbrowser "${1:-https://lofigirl.com/wp-content/uploads/2023/06/}" ;; somafm) shift; mpvcfzf_somafm "${1:-}"; return ;; radioapi) shift; mpvcfzf_radioapi "${1:-}"; return ;; #*) shift; mpvcfzf_usage; return ;; From 009c3a23638ac38c7218c1aad0c38cc7842a9eed Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 07:11:55 +0100 Subject: [PATCH 031/122] docs: Update docs/logbook.html --- docs/logbook.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/logbook.html b/docs/logbook.html index 0b18bb0f..24da8703 100644 --- a/docs/logbook.html +++ b/docs/logbook.html @@ -415,6 +415,7 @@

    Introducing mpvc-web: a mpvc-tui like hack for the web alias mffd="mpvc-fzf -d" # fzf on -d /path/to/music/ alias mffe="mpvc-fzf -e" # fzf on mpvc-equalizer alias mfff="mpvc-fzf -f" # fzf on mpvc play-list + alias mffF="mpvc-fzf -F" # fzf on mpvc play-list alias mffg="mpvc-fzf -g" # fzf get/fetch ytid URL to ytdl-archive alias mffG="mpvc-fzf -G" # bis alias mffl="mpvc-fzf -l" # fzf over local files From 37b0b01805e4f37aac24f61509173cfd39748710 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 07:50:28 +0100 Subject: [PATCH 032/122] extras: Update extras/mpvc-web --- extras/mpvc-web | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extras/mpvc-web b/extras/mpvc-web index e94c4892..a0335d9a 100755 --- a/extras/mpvc-web +++ b/extras/mpvc-web @@ -131,7 +131,7 @@ mpvc_web_select_form() mpvc_web_yts() { cat < + EOF @@ -418,9 +418,9 @@ mpvc_web_index() t4 t6 t8 - cycle + tg rst - + [ From 3b507e855561bd39e01dc5e5ccd2dc49ab1c408a Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 08:05:18 +0100 Subject: [PATCH 033/122] docs: Update docs/index.html --- docs/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index e4e2715a..0686b6de 100644 --- a/docs/index.html +++ b/docs/index.html @@ -140,13 +140,15 @@

    Logbook

    The logbook got big enought to deserve a page on its own, see here: logbook.html

    + +

    - Last-Modified: Friday, 13 September 2024 by gmt4 + πŸ“… Sat, 26 Oct 2024 by gmt4 - Powered by #HTML 🧑 πŸ’š πŸ’™ + ⚑ PoweredBy #HTML

    From fa01ac19b4d30cd91df97e8938dd8e5bec7e479f Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 09:22:40 +0100 Subject: [PATCH 034/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 8c35186d..cce04ab6 100755 --- a/mpvc +++ b/mpvc @@ -856,7 +856,7 @@ mpvc_print_status() { gsub("%statuslofi%", "${?pause==yes:⏸️}${?pause==no:β–·}${!pause:NA}"); gsub("%mutelofi%", "${?mute==yes:πŸ”‡}${?mute==no:πŸ”Š}${!mute:NA}"); - gsub("%singlelofi%", "${?loop-file==inf:πŸ”}${?loop-file==no:πŸ”‚}${!loop-file:NA}") + gsub("%singlelofi%", "${?loop-file==yes:πŸ”}${?loop-file==no:πŸ”‚}${!loop-file:NA}") gsub("%repeatlofi%", "${?loop-playlist==inf:πŸ”„}${?loop-playlist==no:πŸ”ƒ}${!loop-playlist:NA}") gsub("%status%", "${?pause==yes:paused}${?pause==no:play}${!pause:NA}"); From 459cd877c3e9a782238378982279b964304803d8 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 2 Nov 2024 08:02:41 +0100 Subject: [PATCH 035/122] Update mpvc --- mpvc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mpvc b/mpvc index cce04ab6..51d61f47 100755 --- a/mpvc +++ b/mpvc @@ -102,7 +102,7 @@ EOF Formatting: \`$PROGNAME --format\` will interpret the following delimiters if they are found: - %name%, %path%, %dir%, %title%, %artist%, %album%, %albumartist%, comment%, + %filename%, %path%, %dir%, %title%, %artist%, %album%, %albumartist%, comment%, %genre%, %year%, %icy-title%, %percentage%, %playlistlength%, %position%, %repeat%, %single, %status%, %time%, %precisetime%, %speed%, %length%, %remaining%, %volume%, %mute%, %frame%, %width%, %height%, @@ -851,7 +851,7 @@ mpvc_print_status() { F=$(echo "$MPVC_FMTSTR" | awk ' { - split("year genre album icy-title comment volume volume-max mute path height width playback-time ab-loop-[ab] speed force-window video screen aspect idle fullscreen chapter chapters =chapter", RE) + split("year genre album icy-title comment volume volume-max working-directory mute filename path height width playback-time ab-loop-[ab] speed force-window video screen aspect idle fullscreen chapter chapters =chapter", RE) for (i in RE) { re=RE[i]; gsub("%"re"%", "${"re":NA}"); } gsub("%statuslofi%", "${?pause==yes:⏸️}${?pause==no:β–·}${!pause:NA}"); @@ -864,11 +864,9 @@ mpvc_print_status() { gsub("%artist%", "${?metadata/by-key/artist:${metadata/by-key/artist}}${!metadata/by-key/artist:NA}") gsub("%albumartist%", "${?metadata/by-key/album:${metadata/by-key/album}}${!metadata/by-key/album:NA}") gsub("%percentage%", "${percent-pos}") - gsub("%name%", "${filename}") gsub("%repeat%", "${loop-playlist}") gsub("%single%", "${loop-file}") gsub("%frame%", "${estimated-frame-number}") - gsub("%dir%", "${working-directory}") gsub("%remaining%", "${playtime-remaining}") gsub("%length%", "${duration}") gsub("%time%", "${playback-time}") @@ -880,11 +878,9 @@ mpvc_print_status() { } ' ) + # trim/replace times: 00:01:59 -> 01:59 mpvc_cmd "expand-text" "${F}" | - awk '{ - # trim/replace times: 00:01:59 -> 01:59 - gsub(" \\\\r","\n"); gsub(" 00:", " "); gsub("/00:", "/"); print - }' + awk '{ gsub(" \\\\r","\n"); gsub(" 00:", " "); gsub("/00:", "/"); print }' } mpvc_print_status_final() { From 72c365b6635c6696cff7b3e5b2140b8f22481c50 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 2 Nov 2024 12:55:33 +0100 Subject: [PATCH 036/122] Update mpvc --- mpvc | 59 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/mpvc b/mpvc index 51d61f47..539799cc 100755 --- a/mpvc +++ b/mpvc @@ -52,6 +52,8 @@ EOF -x | --speed : Increase/decrease speed relative to the current speed. -X | --speedval : Set absolute speed. -I | --image : Enable adding of images to the queue. + | --color : Enable color (NO_COLOR=) + | --nocolor : Disable color (NO_COLOR=true) -k | --kill : Kill the mpv process controlling the given socket. -K | --killall : Kill all mpv processes indiscriminately. -S | --socket : Set mpv socket [default: $MPVC_SOCKET]. @@ -225,39 +227,40 @@ mpvc_curl_cache_json() mpvc_curl_cache -sL "https://youtube.com/oembed?url=$1" } -mpvc_curl_cache_metadata_json_once() { - filename="${1:-}" - result="${1:-}" - case "$filename" in +mpvc_ytquery_json_once() { + for i in "$@" + do + filename="${i:-}" + case "$filename" in https://youtu.be/watch*|https://youtube.com/watch*|https://www.youtube.com/watch*) filename="$(echo "$filename" | sed 's|\(www.\)\?youtube.com|youtu.be|; s|/watch/\??v=|/|')" - result="$(mpvc_curl_cache_json "$filename")" ;; https://youtu.be/*|https://youtube.com/*|https://www.youtube.com/*) - result="$(mpvc_curl_cache_json "$filename")" + result=$(mpvc_curl_cache_json "$filename") ;; https://yewtu.be/watch*) filename="$(echo "$filename" | sed 's|://yewtu.be|://youtu.be|; s|/watch?v=|/|')" - result="$(mpvc_curl_cache_json "$filename")" + result=$(mpvc_curl_cache_json "$filename") ;; https://yewtu.be/*) filename="$(echo "$filename" | sed 's|://yewtu.be|://youtu.be|')" - result="$(mpvc_curl_cache_json "$filename")" + result=$(mpvc_curl_cache_json "$filename") ;; *) # otherwise, assume its a local file result="{ \"title\":${filename##*/}, }" ;; - esac - printf "$result\n" + esac + printf "$result\n" + done } -mpvc_curl_cache_metadata_json() { - for i in "$@"; do mpvc_curl_cache_metadata_json_once "$i"; done +mpvc_ytquery_json() { + mpvc_ytquery_json_once "$@" } # fn args: given a file/url return its title (may use curl to query YT) -mpvc_curl_cache_title_clean() { - mpvc_curl_cache_metadata_json "$@" | mpvc_getjson 'title' +mpvc_ytquery() { + mpvc_ytquery_json "$@" | mpvc_getjson 'title' } mpvc_getjson() { @@ -321,7 +324,7 @@ mpvc_get_playlist_filename() { if [ "$lid" = "current" ]; then lid=$(mpvc_get playlist-pos); fi filename=$(mpvc_get "playlist/$lid/filename") result=$filename - if [ "$full" != "full" ]; then result=$(mpvc_curl_cache_title_clean "$filename"); fi + if [ "$full" != "full" ]; then result=$(mpvc_ytquery "$filename"); fi result="${result:-${filename%%*/}}" echo "$result" } @@ -339,8 +342,9 @@ mpvc_get_playlist() { fi #mpvc_isinteractive=""; if [ -t 1 ]; then mpvc_isinteractive=1; fi + pct=$(mpvc_cmd expand-text '${percent-pos}') mpvc_get_playlist_once | - awk -v mpvc="$0" -v lpos="$lpos" -v cols="$(mpvc_tty_cols)" -v firstlast="$firstlast" \ + awk -v mpvc="$0" -v pct="$pct" -v lpos="$lpos" -v cols="$(mpvc_tty_cols)" -v firstlast="$firstlast" \ ' BEGIN { # truncate lines x cols when interactive (configurable) TBD @@ -394,27 +398,20 @@ mpvc_get_playlist() { next } + title=mpvc_ytquery($0) + line=sprintf("%2d %s", lid, truncate(title)) if (lpos == lid) { - if (ENVIRON["NO_COLOR"]) - { - title=mpvc_ytquery($0) - printf("%2d %s\n", lid, title) - } - else + if (!ENVIRON["NO_COLOR"]) { - mpvc " cmd expand-text \\${percent-pos}" | getline pct count=int((cols) * (pct/100)) - title=mpvc_ytquery($0) - line=sprintf("%2d %s", lid, truncate(title)) fmtstr="\033[7m%-"count"s\033[0m\n" - printf(fmtstr, line) } + printf(fmtstr, line) } else { - title=mpvc_ytquery($0) - printf("%2d %s\n", lid, truncate(title)) + print line } } ' @@ -565,7 +562,7 @@ mpvc_appendtrack() { # cache media here if media is found in local storage if [ "$MPVC_LOCAL_CACHE" = "true" ]; then filename=$(echo "$filename" | $PROGDIR/mpvc-fzf -C); fi mpvc_ecmdr "loadfile" "$filename" "append-play" || return 1 - quietcheck warn "Adding: $(mpvc_curl_cache_title_clean "$filename")" + quietcheck warn "Adding: $(mpvc_ytquery "$filename")" fi } @@ -1107,8 +1104,8 @@ main() { --filename|filename) shift; mpvc_get_playlist_filename "$@"; return;; --replay|replay) mpvc_set_time "absolute" 0 ;; - ytquery) shift; mpvc_curl_cache_title_clean "$@"; return;; - ytqueryjson) shift; mpvc_curl_cache_metadata_json "$@"; return;; + ytquery) shift; mpvc_ytquery "$@"; return;; + ytqueryjson) shift; mpvc_ytquery_json "$@"; return;; cprev|--chapter-prev|chapter-prev) mpvc_chapter_set +1 "relative" ;; cnext|--chapter-next|chapter-next) mpvc_chapter_set -1 "relative" ;; From 1d0cf0a965bea8f4aa56b342e0487db3e14c4cee Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 09:30:00 +0100 Subject: [PATCH 037/122] docs: Update docs/logbook.html --- docs/logbook.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/logbook.html b/docs/logbook.html index 24da8703..13bdfc8d 100644 --- a/docs/logbook.html +++ b/docs/logbook.html @@ -71,9 +71,9 @@

    Contents

  • #20221213 On using the mpvc-tui prompt
  • #20221214 On using the mpvc-tui -x launcher
  • #20221215 On managing playlists with mpvc autoload/autosave
  • -
  • #20221216 On customizing mpvc-tui look and feel
  • #20221216 Show HN: mpvc-tui – A minimal mpc-like CLI and TUI for controlling mpv
  • #20221217 On issuing direct JSON IPC commands to mpv
  • +
  • #20221218 On customizing mpvc-tui look and feel
  • #20221219 On playing music from streaming services as youtube & co.
  • #20221221 On subscribing and receiving mpv events
  • #20221227 On using mpv together with the fzf fuzzy finder
  • @@ -174,7 +174,7 @@

    On managing playlists with mpvc autoload/autosave, 15 The above enables to arrange a playlist, and once we are happy with it, save it with `mpvc autosave playlist.m3u`, later, we can replay it again with: `mpvc autoload playlist.m3u`.

    -

    On customizing mpvc-tui look and feel, 16 Dec 2022

    +

    On customizing mpvc-tui look and feel, 18 Dec 2022

    While using mpvc-tui, one ends up wanting to configure the minimal look and feel that mpvc-tui provides. To this end the file mpvc.conf under $XDG_CONFIG_HOME/mpvc/ provides a place to overwrite the default settings of mpvc-tui.

    From 35e3d1c5d9832ac5780e50190a99d352bd642dfe Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 3 Nov 2024 08:49:51 +0100 Subject: [PATCH 038/122] Update mpvc --- mpvc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/mpvc b/mpvc index 539799cc..2990de25 100755 --- a/mpvc +++ b/mpvc @@ -398,21 +398,15 @@ mpvc_get_playlist() { next } + fmtstr="%2d %s" title=mpvc_ytquery($0) - line=sprintf("%2d %s", lid, truncate(title)) if (lpos == lid) { if (!ENVIRON["NO_COLOR"]) - { - count=int((cols) * (pct/100)) - fmtstr="\033[7m%-"count"s\033[0m\n" - } - printf(fmtstr, line) - } - else - { - print line + fmtstr="\033[7m%2d %-"int((cols) * (pct/100))"s\033[0m" } + line=sprintf(fmtstr, lid, truncate(title)) + print line } ' QUIETFLAG="true" From fe8e3fa9a3976c8d0ad20e969aab2bb1975b38c6 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 3 Nov 2024 09:10:22 +0100 Subject: [PATCH 039/122] Update mpvc --- mpvc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mpvc b/mpvc index 2990de25..5c77e9fb 100755 --- a/mpvc +++ b/mpvc @@ -206,12 +206,12 @@ mpvc_isotime() { TZ=UTC date -u +"%Y-%m-%dT%H:%M:%SZ"; } mpvc_curl() { - curl -A 'Mozilla/5.0' "$@" + curl -sL -A 'Mozilla/5.0' "$@" } mpvc_curl_cache() { - k=$2 + k=$1 v="$( awk -F'\t' -v k="$k" '{ if ($1 == k) {print $2; exit} }' "$MPVC_CURL_CACHE" )" if [ "${#v}" -eq 0 ]; then @@ -224,7 +224,7 @@ mpvc_curl_cache() mpvc_curl_cache_json() { - mpvc_curl_cache -sL "https://youtube.com/oembed?url=$1" + mpvc_curl_cache "https://youtube.com/oembed?url=$1" } mpvc_ytquery_json_once() { From 002647d35914805c02d38646ec441c9dbc3fcc1b Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 4 Nov 2024 22:11:45 +0100 Subject: [PATCH 040/122] docs: Update docs/mpvc.conf --- docs/mpvc.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/mpvc.conf diff --git a/docs/mpvc.conf b/docs/mpvc.conf new file mode 100644 index 00000000..738ea248 --- /dev/null +++ b/docs/mpvc.conf @@ -0,0 +1,12 @@ +# +# @file mpvc.conf example +# @url github.com/gmt4/mpvc +# + +# mpvc-tui +MPVC_TUI_COLOR0='\033[1;36m' +MPVC_TUI_COLOR1='\033[1;37m' + +# mpvc +MPVC_LOCAL_CACHE="true" +MPVC_FMTSTR='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi% 🎧' From b9b6fdb7f45391cae507c7880f14ed89b33a2f68 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Tue, 5 Nov 2024 21:53:25 +0100 Subject: [PATCH 041/122] Update mpvc --- mpvc | 1 + 1 file changed, 1 insertion(+) diff --git a/mpvc b/mpvc index 5c77e9fb..370b1c54 100755 --- a/mpvc +++ b/mpvc @@ -234,6 +234,7 @@ mpvc_ytquery_json_once() { case "$filename" in https://youtu.be/watch*|https://youtube.com/watch*|https://www.youtube.com/watch*) filename="$(echo "$filename" | sed 's|\(www.\)\?youtube.com|youtu.be|; s|/watch/\??v=|/|')" + result=$(mpvc_curl_cache_json "$filename") ;; https://youtu.be/*|https://youtube.com/*|https://www.youtube.com/*) result=$(mpvc_curl_cache_json "$filename") From b3b7f91b7917d2c91bd73cad02f2ae51afbb84c8 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 7 Nov 2024 01:43:35 +0100 Subject: [PATCH 042/122] docs: Update docs/mpvc.conf --- docs/mpvc.conf | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/mpvc.conf b/docs/mpvc.conf index 738ea248..4e939517 100644 --- a/docs/mpvc.conf +++ b/docs/mpvc.conf @@ -3,10 +3,14 @@ # @url github.com/gmt4/mpvc # -# mpvc-tui -MPVC_TUI_COLOR0='\033[1;36m' -MPVC_TUI_COLOR1='\033[1;37m' +# mpvc config +MPVC_MPV=/usr/bin/mpv +MPVC_SOCAT=/usr/bin/socat -# mpvc MPVC_LOCAL_CACHE="true" -MPVC_FMTSTR='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi% 🎧' +MPVC_FMTSTR_LOFI='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi%%videolofi%' +MPVC_FMTSTR='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi%%videolofi%' + +# mpvc-tui config +MPVC_TUI_COLOR0='\033[1;36m' +MPVC_TUI_COLOR1='\033[1;37m' From dbd1de645c8f6186fcd6c0152d1c314648e96b93 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 7 Nov 2024 01:43:41 +0100 Subject: [PATCH 043/122] extras: Update extras/mpvc-fzf --- extras/mpvc-fzf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf index 64f8fbba..9208a3e0 100755 --- a/extras/mpvc-fzf +++ b/extras/mpvc-fzf @@ -274,7 +274,7 @@ mpvcfzf_preview() --bind='ctrl-t:execute-silent(mpvc add {+1} &)' \ --bind='ctrl-space:execute-silent(mpvc toggle &)' \ \ - --preview-window='up:5' \ + --preview-window="up:$(mpvc statussz)" \ --preview="mpvc" \ "$@" } From 2e9bc01f191cfd424e8452d8dfada648986323f0 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 7 Nov 2024 20:48:16 +0100 Subject: [PATCH 044/122] Update mpvc --- mpvc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 370b1c54..47abbf9d 100755 --- a/mpvc +++ b/mpvc @@ -159,7 +159,7 @@ mpvc_defaults() QUIETFLAG="${QUIETFLAG:-}" MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}" MPVC_FMTSTR="${MPVC_FMTSTR:-}" - MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi% 🎧'} + MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi%%videolofi%'} # print default status of mpv instance if [ -z "$MPVC_FMTSTR" ]; then @@ -850,6 +850,7 @@ mpvc_print_status() { gsub("%mutelofi%", "${?mute==yes:πŸ”‡}${?mute==no:πŸ”Š}${!mute:NA}"); gsub("%singlelofi%", "${?loop-file==yes:πŸ”}${?loop-file==no:πŸ”‚}${!loop-file:NA}") gsub("%repeatlofi%", "${?loop-playlist==inf:πŸ”„}${?loop-playlist==no:πŸ”ƒ}${!loop-playlist:NA}") + gsub("%videolofi%", "${?video!=no:πŸ“€}${?video==no:🎧}${!video:NA}") gsub("%status%", "${?pause==yes:paused}${?pause==no:play}${!pause:NA}"); gsub("%title%", "${media-title}") @@ -898,6 +899,8 @@ mpvc_tty_size() { mpvc_tty_lines() { ttysize=$(mpvc_tty_size); echo "${ttysize%% *}"; } mpvc_tty_cols() { ttysize=$(mpvc_tty_size); echo "${ttysize##* }"; } +mpvc_status_size() { printf "%s" "$MPVC_FMTSTR\\r" | grep -o '\\r' | wc -l ; } + mpvc_get_terminal_height() { plpos="$1" lcount="$2" @@ -1140,6 +1143,7 @@ main() { --ttysize|ttysize) mpvc_tty_size; QUIETFLAG=true;; --ttycols|ttycols) mpvc_tty_cols; QUIETFLAG=true;; --ttylines|ttylines) mpvc_tty_lines; QUIETFLAG=true;; + --statussz|statussz) mpvc_status_size; QUIETFLAG=true;; # global argument parsing -f|--format) shift; MPVC_FMTSTR="${1:-}" ;; From 73ba2f9eb009a370d4c3e79c8b85275abe5a5619 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 7 Nov 2024 23:11:46 +0100 Subject: [PATCH 045/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 47abbf9d..e804c1c6 100755 --- a/mpvc +++ b/mpvc @@ -899,7 +899,7 @@ mpvc_tty_size() { mpvc_tty_lines() { ttysize=$(mpvc_tty_size); echo "${ttysize%% *}"; } mpvc_tty_cols() { ttysize=$(mpvc_tty_size); echo "${ttysize##* }"; } -mpvc_status_size() { printf "%s" "$MPVC_FMTSTR\\r" | grep -o '\\r' | wc -l ; } +mpvc_status_size() { printf "%s" "$MPVC_FMTSTR" | awk '{r=split($0,a,/\\r/); print r}'; } mpvc_get_terminal_height() { plpos="$1" From ef7a21c62018bc6b35e20676c377fb55bc25bdb1 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 9 Nov 2024 05:53:48 +0100 Subject: [PATCH 046/122] mpvc --- mpvc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mpvc b/mpvc index e804c1c6..cdd295ec 100755 --- a/mpvc +++ b/mpvc @@ -160,15 +160,16 @@ mpvc_defaults() MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}" MPVC_FMTSTR="${MPVC_FMTSTR:-}" MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi%%videolofi%'} - - # print default status of mpv instance - if [ -z "$MPVC_FMTSTR" ]; then - MPVC_FMTSTR="\ + MPVC_FMTSTR_DFLT="\ %artist% - %title% \r\ [%status%] #%position%/%playlistlength% %time%/%length% (%percentage%%%) \r\ vol:%volume%%% mute:%mute% repeat:%repeat% single:%single% \r\ vid:%video% scr:%screen% win:%force-window% fs:%fullscreen% \r\ chapter:%chapter% %=chapter%/%chapters% idle:%idle%" + + # print default status of mpv instance + if [ -z "$MPVC_FMTSTR" ]; then + MPVC_FMTSTR="${MPVC_FMTSTR_DFLT}" fi } From 5ef80548df37a4566a0c3bc751d8f48bba8139ea Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 9 Nov 2024 05:53:59 +0100 Subject: [PATCH 047/122] extras/mpvc-tui --- extras/mpvc-tui | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index f8cb195a..04ba568f 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -54,8 +54,9 @@ mpvctui_defaults() MPVC_TUI_TERM=${MPVC_TUI_TERM:-xterm} MPVC_TUI_SHELL=$(readlink -f /proc/$$/exe) - MPVC_TUI_STATUS_CMD="${MPVC_TUI_STATUS_CMD:-status}" - MPVC_TUI_PLAYLIST_CMD="${MPVC_TUI_PLAYLIST_CMD:-playlist}" + MPVC_CMD_STATUS="${MPVC_CMD_STATUS:-status}" + MPVC_CMD_PLAYLIST="${MPVC_CMD_PLAYLIST:-playlist}" + export MPVC_TUI_CLINE=${MPVC_TUI_CLINE:-11} } @@ -139,9 +140,9 @@ mpvctui_watcher() { mpvctui_header0 "${MPVC_TUI_HEADER0}$(mpvctui_tips)" mpvctui_header1 "Status" - mpvc "${MPVC_TUI_STATUS_CMD}" + mpvc "${MPVC_CMD_STATUS}" mpvctui_header1 "Playlist" - mpvc "${MPVC_TUI_PLAYLIST_CMD}" + mpvc "${MPVC_CMD_PLAYLIST}" mpvctui_header1 "Prompt" } From 5ed847ac259cb5bc0c9b14c835d1f675fd38782b Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 9 Nov 2024 06:08:00 +0100 Subject: [PATCH 048/122] extras/mpvc-tui --- extras/mpvc-tui | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index 04ba568f..72b04bc3 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -180,6 +180,14 @@ mpvctui_watch() done } +mpvctui_watch_auto() +{ + mpvc -q --mpv & + ( sleep 2 && if [ "$#" -gt 0 ]; then mpvc --append "$@"; fi ) + ( sleep 1; pgrep -f "$PROGNAME -n" || setsid "$0" -n ) & + mpvctui_watch +} + mpvctui_mouse() { clear @@ -354,25 +362,20 @@ mpvctui_main() while getopts "$optflags" flag; do case "$flag" in - d) MPVC_TUI_DIR="$OPTARG"; cd "$MPVC_TUI_DIR" || return;; - h) shift; mpvctui_usage ;; - H) shift; cat $MPVC_TUI_SCROBBLER ;; - t) shift; mpvctui_watch ;; - T) shift; - mpvc -q --mpv & - ( sleep 2 && if [ "$#" -gt 0 ]; then mpvc --append "$@"; fi ) - ( sleep 1; pgrep -f "$PROGNAME -n" || setsid "$0" -n ) & - mpvctui_watch - ;; - M) shift; mpvctui_launch "-m$OPTARG"; exit ;; # -g 15x1 - m) shift; mpvctui_mouse "$OPTARG" ;; - n) shift; mpvctui_notify_loop "${1:-}" ;; - N) shift; mpvctui_notify "${@}" ;; - k) shift; pkill -f "$PROGNAME" ;; - s) shift; mpvctui_suggest ;; - S) shift; mpvctui_notify_loop_cli "${1:-}" ;; - u) shift; MPVC_TUI_UPDATEC="$OPTARG" ;; - x) shift; mpvctui_launch "$@"; exit ;; + d|dir) MPVC_TUI_DIR="$OPTARG"; cd "$MPVC_TUI_DIR" || return;; + h|help) shift; mpvctui_usage ;; + H|history) shift; cat "$MPVC_TUI_SCROBBLER" ;; + t|tui) shift; mpvctui_watch ;; + T|Tui) shift; mpvctui_watch_auto "$@" ;; + M|Mouse) shift; mpvctui_launch "-m$OPTARG"; exit ;; # -g 15x1 + m|mouse) shift; mpvctui_mouse "$OPTARG" ;; + n|Notify) shift; mpvctui_notify_loop "${1:-}" ;; + N|notify) shift; mpvctui_notify "${@}" ;; + k|kill) shift; pkill -f "$PROGNAME" ;; + s|suggest) shift; mpvctui_suggest ;; + S|scrobler) shift; mpvctui_notify_loop_cli "${1:-}" ;; + u|updatec) shift; MPVC_TUI_UPDATEC="$OPTARG" ;; + x|launch) shift; mpvctui_launch "$@"; exit ;; *) mpvctui_usage;; esac From 2663256d7d4006debaf3a7df3a53fb1d7c57d8c5 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 9 Nov 2024 06:51:24 +0100 Subject: [PATCH 049/122] extras: Update extras/mpvc-tui --- extras/mpvc-tui | 52 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index 72b04bc3..26527078 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -341,41 +341,43 @@ mpvctui_launch() mpvctui_usage() { - echo "usage: $PROGNAME -[$optflags] args # @version $PROGVERSION (c) $PROGAUTHOR $PROGURL" - echo " -d : Set the WD to the media directory given as argument" - echo " -n : Desktop notification using notify on mpvc events (notify-send*)" - echo " -s : Suggest a random media to play based on previous media played" - echo " -t : Starts the $PROGNAME to manage the mpv playlist (rlwrap*)" - echo " -T : Combo that starts $PROGNAME -t -n, and adds media given as args" - echo " -x : Starts $PROGNAME in a new $MPVC_TUI_TERM (config \$MPVC_TUI_TERM) [combine -x with other opts]" - echo " -v : Prints the $PROGNAME version." + echo "usage: $PROGNAME opts # @version $PROGVERSION (c) $PROGAUTHOR $PROGURL" + echo " -d|dir : Set the WD to the media directory given as argument" + echo " -n|notify : Desktop notification using notify on mpvc events (notify-send*)" + echo " -s|suggest : Suggest a random media to play based on previous media played" + echo " -S|scrobler: Starts the $PROGNAME scrobbler" + echo " -H|history : Starts the $PROGNAME history" + echo " -t|tui : Starts the $PROGNAME to manage the mpv playlist (rlwrap*)" + echo " -T|Tui : Combo that starts $PROGNAME -t -n, and adds media given as args" + echo " -x|launch : Starts $PROGNAME in a new $MPVC_TUI_TERM (\$MPVC_TUI_TERM) # combine with " + echo " -v|version : Prints the $PROGNAME version." echo "*tips: If unsure about where to begin, start with: $PROGNAME -d /path/to/media/ -T" exit; } -optflags="d:hHktTm:M:nNsSP:u:x" mpvctui_main() { mpvctui_config if [ $# -eq 0 ]; then mpvctui_usage; fi - while getopts "$optflags" flag; + for arg in "$@"; do - case "$flag" in - d|dir) MPVC_TUI_DIR="$OPTARG"; cd "$MPVC_TUI_DIR" || return;; - h|help) shift; mpvctui_usage ;; - H|history) shift; cat "$MPVC_TUI_SCROBBLER" ;; - t|tui) shift; mpvctui_watch ;; - T|Tui) shift; mpvctui_watch_auto "$@" ;; - M|Mouse) shift; mpvctui_launch "-m$OPTARG"; exit ;; # -g 15x1 - m|mouse) shift; mpvctui_mouse "$OPTARG" ;; - n|Notify) shift; mpvctui_notify_loop "${1:-}" ;; - N|notify) shift; mpvctui_notify "${@}" ;; - k|kill) shift; pkill -f "$PROGNAME" ;; - s|suggest) shift; mpvctui_suggest ;; - S|scrobler) shift; mpvctui_notify_loop_cli "${1:-}" ;; - u|updatec) shift; MPVC_TUI_UPDATEC="$OPTARG" ;; - x|launch) shift; mpvctui_launch "$@"; exit ;; + arg1="${2:-}" + case "$arg" in + -d|dir) shift; MPVC_TUI_DIR="$arg1"; cd "$MPVC_TUI_DIR" || return;; + -h|help) shift; mpvctui_usage ;; + -H|history) shift; cat "$MPVC_TUI_SCROBBLER" ;; + -t|tui) shift; mpvctui_watch ;; + -T|Tui) shift; mpvctui_watch_auto "$@" ;; + -M|Mouse) shift; mpvctui_launch "-m$arg1"; exit ;; # -g 15x1 + -m|mouse) shift; mpvctui_mouse "$arg1" ;; + -n|Notify) shift; mpvctui_notify_loop "${1:-}" ;; + -N|notify) shift; mpvctui_notify "$@" ;; + -k|kill) shift; pkill -f "$PROGNAME" ;; + -s|suggest) shift; mpvctui_suggest ;; + -S|scrobler) shift; mpvctui_notify_loop_cli "${1:-}" ;; + -u|updatec) shift; MPVC_TUI_UPDATEC="$arg1" ;; + -x|launch) shift; mpvctui_launch "$@"; exit ;; *) mpvctui_usage;; esac From 144de354c274911cb542257452b8bb661f230086 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 9 Nov 2024 07:31:11 +0100 Subject: [PATCH 050/122] Update README.md --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ec280a4b..00f27a71 100644 --- a/README.md +++ b/README.md @@ -192,14 +192,16 @@ usage: mpvc opts # @version v1.5 (c) gmt4 https://github.com/gmt4/mpvc ### mpvc-tui ```console -usage: mpvc-tui -[d:hHktTm:M:nNsSP:u:x] args # @version v1.5 (c) gmt4 https://github.com/gmt4/mpvc - -d : Set the WD to the media directory given as argument - -n : Desktop notification using notify on mpvc events (notify-send*) - -s : Suggest a random media to play based on previous media played - -t : Starts the mpvc-tui to manage the mpv playlist (rlwrap*) - -T : Combo that starts mpvc-tui -t -n, and adds media given as args - -x : Starts mpvc-tui in a new xterm (config $MPVC_TUI_TERM) [combine -x with other opts] - -v : Prints the mpvc-tui version. +usage: mpvc-tui opts # @version v1.5 (c) gmt4 https://github.com/gmt4/mpvc + -d|dir : Set the WD to the media directory given as argument + -n|notify : Desktop notification using notify on mpvc events (notify-send*) + -s|suggest : Suggest a random media to play based on previous media played + -S|scrobler: Starts the mpvc-tui scrobbler + -H|history : Starts the mpvc-tui history + -t|tui : Starts the mpvc-tui to manage the mpv playlist (rlwrap*) + -T|Tui : Combo that starts mpvc-tui -t -n, and adds media given as args + -x|launch : Starts mpvc-tui in a new xterm ($MPVC_TUI_TERM) # combine with + -v|version : Prints the mpvc-tui version. *tips: If unsure about where to begin, start with: mpvc-tui -d /path/to/media/ -T ```` From a18cf1e03f86426199b6547e578f1abd0b7cb25f Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 9 Nov 2024 22:13:59 +0100 Subject: [PATCH 051/122] Update mpvc --- mpvc | 1 + 1 file changed, 1 insertion(+) diff --git a/mpvc b/mpvc index cdd295ec..753a7692 100755 --- a/mpvc +++ b/mpvc @@ -1006,6 +1006,7 @@ main() { arg1=${1:-} case "$arg1" in ytquery|ytqueryjson|--tac|tac|--lowfi|lowfi) ;; + --ttysize|ttysize|--ttycols|ttycols|--ttylines|ttylines|--statussz|statussz) ;; -k|--kill|kill|-K|--killall|killall) ;; -c|--crop|crop|-C|--clear|clear|cmd|sockcmd|socklist|--socklist) ;; -a|add|append|-A|load|--load|playnext|--playnext|-n|playnow|--playnow|mpv|--mpv|stash|--stash|--toggle|toggle|-q|--quiet) ;; From 933780f94a6a5d78567e4a7f3e5bdf084f3b3978 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 10 Nov 2024 08:49:07 +0100 Subject: [PATCH 052/122] Update mpvc --- mpvc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mpvc b/mpvc index 753a7692..8bdd8dd1 100755 --- a/mpvc +++ b/mpvc @@ -344,9 +344,8 @@ mpvc_get_playlist() { fi #mpvc_isinteractive=""; if [ -t 1 ]; then mpvc_isinteractive=1; fi - pct=$(mpvc_cmd expand-text '${percent-pos}') mpvc_get_playlist_once | - awk -v mpvc="$0" -v pct="$pct" -v lpos="$lpos" -v cols="$(mpvc_tty_cols)" -v firstlast="$firstlast" \ + awk -v mpvc="$0" -v lpos="$lpos" -v cols="$(mpvc_tty_cols)" -v firstlast="$firstlast" \ ' BEGIN { # truncate lines x cols when interactive (configurable) TBD @@ -405,7 +404,11 @@ mpvc_get_playlist() { if (lpos == lid) { if (!ENVIRON["NO_COLOR"]) - fmtstr="\033[7m%2d %-"int((cols) * (pct/100))"s\033[0m" + { + mpvc " cmd expand-text \\${percent-pos}" | getline pct + count=int((cols-4) * (pct/100)) + fmtstr="\033[7m%2d %-"count"s\033[0m" + } } line=sprintf(fmtstr, lid, truncate(title)) print line From fdd93fc08570669da7c5199c59ffa3f54b44e9ed Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 10 Nov 2024 19:30:02 +0100 Subject: [PATCH 053/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 8bdd8dd1..018e2008 100755 --- a/mpvc +++ b/mpvc @@ -406,7 +406,7 @@ mpvc_get_playlist() { if (!ENVIRON["NO_COLOR"]) { mpvc " cmd expand-text \\${percent-pos}" | getline pct - count=int((cols-4) * (pct/100)) + count=int((cols-(length(lid)+1+1)) * (pct/100)) fmtstr="\033[7m%2d %-"count"s\033[0m" } } From a441cfefd412ef463d65b3ad6378e45b36eef0a0 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:33:46 +0100 Subject: [PATCH 054/122] Update mpvc --- mpvc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mpvc b/mpvc index 018e2008..ce41042c 100755 --- a/mpvc +++ b/mpvc @@ -1008,7 +1008,7 @@ main() { mpvc_config arg1=${1:-} case "$arg1" in - ytquery|ytqueryjson|--tac|tac|--lowfi|lowfi) ;; + ytquery|ytqueryjson|--tac|tac|--lowfi|lowfi|--hifi|hifi) ;; --ttysize|ttysize|--ttycols|ttycols|--ttylines|ttylines|--statussz|statussz) ;; -k|--kill|kill|-K|--killall|killall) ;; -c|--crop|crop|-C|--clear|clear|cmd|sockcmd|socklist|--socklist) ;; @@ -1143,13 +1143,16 @@ main() { --delay|delay) mpvc_delay;; --wait|wait) mpvc_wait;; --tac|tac) mpvc_tac; exit 0;; - --lowfi|lowfi) MPVC_FMTSTR="$MPVC_FMTSTR_LOFI" ;; --ttysize|ttysize) mpvc_tty_size; QUIETFLAG=true;; --ttycols|ttycols) mpvc_tty_cols; QUIETFLAG=true;; --ttylines|ttylines) mpvc_tty_lines; QUIETFLAG=true;; --statussz|statussz) mpvc_status_size; QUIETFLAG=true;; + --hifi|hifi) MPVC_FMTSTR="$MPVC_FMTSTR_DFLT" ;; + --lowfi|lowfi) MPVC_FMTSTR="$MPVC_FMTSTR_LOFI" ;; + --status|status) ;; + # global argument parsing -f|--format) shift; MPVC_FMTSTR="${1:-}" ;; -S|--socket) shift; mpvc_handle_socket "${1:-}";; From fb93ea9ade0c6de93267086393e060526d01d3e3 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:36:55 +0100 Subject: [PATCH 055/122] extras: Update extras/mpvc-tui --- extras/mpvc-tui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index 26527078..4e094096 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -57,7 +57,7 @@ mpvctui_defaults() MPVC_CMD_STATUS="${MPVC_CMD_STATUS:-status}" MPVC_CMD_PLAYLIST="${MPVC_CMD_PLAYLIST:-playlist}" - export MPVC_TUI_CLINE=${MPVC_TUI_CLINE:-11} + export MPVC_TUI_CLINE=${MPVC_TUI_CLINE:-$(( $(mpvc statussz) + 6 ))} } # Load user config From d2bd1d94d0c07e349b01497800dc1f5ccffb3b27 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Tue, 12 Nov 2024 07:13:30 +0100 Subject: [PATCH 056/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index ce41042c..a8fe6907 100755 --- a/mpvc +++ b/mpvc @@ -159,7 +159,7 @@ mpvc_defaults() QUIETFLAG="${QUIETFLAG:-}" MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}" MPVC_FMTSTR="${MPVC_FMTSTR:-}" - MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi%%videolofi%'} + MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% πŸ“š%=chapter%/%chapters% %mutelofi%%volume%%% %singlelofi%%repeatlofi%%videolofi%'} MPVC_FMTSTR_DFLT="\ %artist% - %title% \r\ [%status%] #%position%/%playlistlength% %time%/%length% (%percentage%%%) \r\ From 839eb1ad96b16f9b48fb8a7a9be431c6b3e25379 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Tue, 12 Nov 2024 07:13:43 +0100 Subject: [PATCH 057/122] docs: Update docs/mpvc.conf --- docs/mpvc.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/mpvc.conf b/docs/mpvc.conf index 4e939517..bfa5edf4 100644 --- a/docs/mpvc.conf +++ b/docs/mpvc.conf @@ -8,8 +8,8 @@ MPVC_MPV=/usr/bin/mpv MPVC_SOCAT=/usr/bin/socat MPVC_LOCAL_CACHE="true" -MPVC_FMTSTR_LOFI='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi%%videolofi%' -MPVC_FMTSTR='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi%%videolofi%' +MPVC_FMTSTR_LOFI='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% πŸ“š%=chapter%/%chapters% %mutelofi%%volume%%% %singlelofi%%repeatlofi%%videolofi%' +MPVC_FMTSTR='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% πŸ“š%=chapter%/%chapters% %mutelofi%%volume%%% %singlelofi%%repeatlofi%%videolofi%' # mpvc-tui config MPVC_TUI_COLOR0='\033[1;36m' From d57b3e1d728624e05cd8385bc792f896f47711a6 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 16 Nov 2024 17:55:28 +0100 Subject: [PATCH 058/122] extras: Update extras/mpvc-fzf --- extras/mpvc-fzf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf index 9208a3e0..0d388041 100755 --- a/extras/mpvc-fzf +++ b/extras/mpvc-fzf @@ -354,8 +354,8 @@ mpvcfzf_equalizer() mpvc-equalizer preset | mpvcfzf_preview --prompt="(equalizer) " \ --header="$PROGNAME help: $MPVC_FZF_BIND_HELP" \ - --bind='ctrl-x:execute(mpvc-equalizer dec {1} &)' \ - --bind='ctrl-v:execute(mpvc-equalizer inc {1} &)' \ + --bind='ctrl-x:execute-silent(mpvc-equalizer dec {1} &)' \ + --bind='ctrl-v:execute-silent(mpvc-equalizer inc {1} &)' \ --bind='ctrl-space:execute-silent(mpvc-equalizer reset)' \ --bind='ctrl-o:execute-silent(mpvc-equalizer preset {-1} | mpvc-equalizer load)' \ --bind='ctrl-s:reload(mpvc-equalizer bars)' \ From eddb77ef62bccce933896576e8e938fe38bda328 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 16 Nov 2024 18:47:55 +0100 Subject: [PATCH 059/122] Update mpvc --- mpvc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mpvc b/mpvc index a8fe6907..75b96679 100755 --- a/mpvc +++ b/mpvc @@ -159,7 +159,7 @@ mpvc_defaults() QUIETFLAG="${QUIETFLAG:-}" MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}" MPVC_FMTSTR="${MPVC_FMTSTR:-}" - MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% πŸ“š%=chapter%/%chapters% %mutelofi%%volume%%% %singlelofi%%repeatlofi%%videolofi%'} + MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %=chapter%/%chapters% %mutelofi%%volume%%% %singlelofi%%repeatlofi%%idlelofi%%videolofi%'} MPVC_FMTSTR_DFLT="\ %artist% - %title% \r\ [%status%] #%position%/%playlistlength% %time%/%length% (%percentage%%%) \r\ @@ -848,15 +848,16 @@ mpvc_print_status() { awk ' { split("year genre album icy-title comment volume volume-max working-directory mute filename path height width playback-time ab-loop-[ab] speed force-window video screen aspect idle fullscreen chapter chapters =chapter", RE) - for (i in RE) { re=RE[i]; gsub("%"re"%", "${"re":NA}"); } + for (i in RE) { re=RE[i]; gsub("%"re"%", "${"re":0}"); } gsub("%statuslofi%", "${?pause==yes:⏸️}${?pause==no:β–·}${!pause:NA}"); gsub("%mutelofi%", "${?mute==yes:πŸ”‡}${?mute==no:πŸ”Š}${!mute:NA}"); gsub("%singlelofi%", "${?loop-file==yes:πŸ”}${?loop-file==no:πŸ”‚}${!loop-file:NA}") gsub("%repeatlofi%", "${?loop-playlist==inf:πŸ”„}${?loop-playlist==no:πŸ”ƒ}${!loop-playlist:NA}") gsub("%videolofi%", "${?video!=no:πŸ“€}${?video==no:🎧}${!video:NA}") + gsub("%idlelofi%", "${?idle==yes:∞}${?idle==no:βˆ…}${!idle:NA}") - gsub("%status%", "${?pause==yes:paused}${?pause==no:play}${!pause:NA}"); + gsub("%status%", "${?pause==yes:pause}${?pause==no:play}${!pause:NA}"); gsub("%title%", "${media-title}") gsub("%artist%", "${?metadata/by-key/artist:${metadata/by-key/artist}}${!metadata/by-key/artist:NA}") gsub("%albumartist%", "${?metadata/by-key/album:${metadata/by-key/album}}${!metadata/by-key/album:NA}") From f90dcf3dec1558b103c52e3c6632135469da9887 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 16 Nov 2024 18:55:50 +0100 Subject: [PATCH 060/122] docs: Update docs/mpvc.conf --- docs/mpvc.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/mpvc.conf b/docs/mpvc.conf index bfa5edf4..9b32ce4f 100644 --- a/docs/mpvc.conf +++ b/docs/mpvc.conf @@ -8,8 +8,8 @@ MPVC_MPV=/usr/bin/mpv MPVC_SOCAT=/usr/bin/socat MPVC_LOCAL_CACHE="true" -MPVC_FMTSTR_LOFI='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% πŸ“š%=chapter%/%chapters% %mutelofi%%volume%%% %singlelofi%%repeatlofi%%videolofi%' -MPVC_FMTSTR='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% πŸ“š%=chapter%/%chapters% %mutelofi%%volume%%% %singlelofi%%repeatlofi%%videolofi%' +MPVC_FMTSTR_LOFI='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %=chapter%/%chapters% %mutelofi%%volume%%% %singlelofi%%repeatlofi%%idlelofi%%videolofi%' +MPVC_FMTSTR='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%playlistlength% %=chapter%/%chapters% %mutelofi%%volume%%% %singlelofi%%repeatlofi%%idlelofi%%videolofi%' # mpvc-tui config MPVC_TUI_COLOR0='\033[1;36m' From 3e47a1f60595859433c17f0a61b11917be530d7e Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 16 Nov 2024 19:00:22 +0100 Subject: [PATCH 061/122] extras: Update extras/mpvc-tui --- extras/mpvc-tui | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index 4e094096..e3f5c1bb 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -124,7 +124,7 @@ mpvctui_header2() { mpvctui_headerc '─' '[' ']' "$MPVC_TUI_COLOR2" " + $* "; } mpvctui_tips() { if [ "$MPVC_TUI_TIPS" = "false" ]; then return; fi - tip=$(( count % 80 )) + tip=$(( mpvctui_count % 80 )) case $tip in 0|1|2) echo ": type control+c to enter prompt";; 10|11|12) echo ": Check $PROGURL";; @@ -132,12 +132,14 @@ mpvctui_tips() 30|31|32) echo ": Config at ${MPVC_CONFIG##$HOME/}";; 40|41|42) echo ": Launch from WM with: $PROGNAME -x";; 50|51|52) echo ": version $PROGNAME $PROGVERSION at $PROGURL";; - 60|61|62) echo ": Update $MPVC_TUI_UPDATEC secs refresh $((count % MPVC_TUI_CLEARC))/$MPVC_TUI_CLEARC shell $MPVC_TUI_SHELL";; + 60|61|62) echo ": Update $MPVC_TUI_UPDATEC secs refresh $((mpvctui_count % MPVC_TUI_CLEARC))/$MPVC_TUI_CLEARC shell $MPVC_TUI_SHELL";; esac } mpvctui_watcher() { + # c=$(mpvc get playlist-count) cc=$(mpvc get chapters) if [ $c -eq 1 -a $cc -gt 0 ] then MPVC_CMD_PLAYLIST=chapter-list; else MPVC_CMD_PLAYLIST=playlist; fi + mpvctui_header0 "${MPVC_TUI_HEADER0}$(mpvctui_tips)" mpvctui_header1 "Status" mpvc "${MPVC_CMD_STATUS}" @@ -167,15 +169,15 @@ mpvctui_input() mpvctui_watch() { - count=0 + mpvctui_count=0 trap mpvctui_input INT while : do output=$(mpvctui_watcher 2>&1) - if [ $(( count % MPVC_TUI_CLEARC )) -eq 0 ]; then printf "${MPVC_TUI_CLEAR}"; fi + if [ $(( mpvctui_count % MPVC_TUI_CLEARC )) -eq 0 ]; then printf "${MPVC_TUI_CLEAR}"; fi printf "${MPVC_TUI_CUP}" echo "$output" - count=$(( count + 1 )) + mpvctui_count=$(( mpvctui_count + 1 )) sleep $MPVC_TUI_UPDATEC done } From 7ec2e20bf002200641d43f000262c4fe5722c193 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 17 Nov 2024 07:11:49 +0100 Subject: [PATCH 062/122] docs: Update docs/mpvc.conf --- docs/mpvc.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/mpvc.conf b/docs/mpvc.conf index 9b32ce4f..137f475c 100644 --- a/docs/mpvc.conf +++ b/docs/mpvc.conf @@ -14,3 +14,4 @@ MPVC_FMTSTR='[%status%] %statuslofi% %title% 🎢 %time%/%length% #%position%/%p # mpvc-tui config MPVC_TUI_COLOR0='\033[1;36m' MPVC_TUI_COLOR1='\033[1;37m' +MPVC_TUI_COLOR2='\033[0;36m' From 2f14fd77eb170a961793021f3d5d18133ba14638 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 17 Nov 2024 07:11:52 +0100 Subject: [PATCH 063/122] extras: Update extras/mpvc-tui --- extras/mpvc-tui | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index e3f5c1bb..c4db7bdf 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -56,6 +56,7 @@ mpvctui_defaults() MPVC_CMD_STATUS="${MPVC_CMD_STATUS:-status}" MPVC_CMD_PLAYLIST="${MPVC_CMD_PLAYLIST:-playlist}" + MPVC_CMD_CHAPTERLIST=${MPVC_CMD_CHAPTERLIST:-chapter-list} export MPVC_TUI_CLINE=${MPVC_TUI_CLINE:-$(( $(mpvc statussz) + 6 ))} } @@ -138,13 +139,19 @@ mpvctui_tips() mpvctui_watcher() { - # c=$(mpvc get playlist-count) cc=$(mpvc get chapters) if [ $c -eq 1 -a $cc -gt 0 ] then MPVC_CMD_PLAYLIST=chapter-list; else MPVC_CMD_PLAYLIST=playlist; fi + c=$(mpvc get playlist-count) + cc=$(mpvc get chapters) mpvctui_header0 "${MPVC_TUI_HEADER0}$(mpvctui_tips)" mpvctui_header1 "Status" mpvc "${MPVC_CMD_STATUS}" mpvctui_header1 "Playlist" mpvc "${MPVC_CMD_PLAYLIST}" + if [ "$c" -eq 1 -a "$cc" -gt 0 ] + then + mpvctui_header2 "Chapterlist" + mpvc "${MPVC_CMD_CHAPTERLIST}" + fi mpvctui_header1 "Prompt" } From c32bd55419f87bf3aa384231325151e9ee720e66 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 17 Nov 2024 11:04:25 +0100 Subject: [PATCH 064/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 75b96679..e8c4ba86 100755 --- a/mpvc +++ b/mpvc @@ -855,7 +855,7 @@ mpvc_print_status() { gsub("%singlelofi%", "${?loop-file==yes:πŸ”}${?loop-file==no:πŸ”‚}${!loop-file:NA}") gsub("%repeatlofi%", "${?loop-playlist==inf:πŸ”„}${?loop-playlist==no:πŸ”ƒ}${!loop-playlist:NA}") gsub("%videolofi%", "${?video!=no:πŸ“€}${?video==no:🎧}${!video:NA}") - gsub("%idlelofi%", "${?idle==yes:∞}${?idle==no:βˆ…}${!idle:NA}") + gsub("%idlelofi%", "${?idle==yes:♾️}${?idle==no:βˆ…}${!idle:NA}") gsub("%status%", "${?pause==yes:pause}${?pause==no:play}${!pause:NA}"); gsub("%title%", "${media-title}") From e368924adfed790370813e96a8bd1cb1aea07c83 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sun, 17 Nov 2024 12:02:21 +0100 Subject: [PATCH 065/122] extras: Update extras/mpvc-tui --- extras/mpvc-tui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index c4db7bdf..22838f8d 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -147,7 +147,7 @@ mpvctui_watcher() mpvc "${MPVC_CMD_STATUS}" mpvctui_header1 "Playlist" mpvc "${MPVC_CMD_PLAYLIST}" - if [ "$c" -eq 1 -a "$cc" -gt 0 ] + if [ "$cc" != "null" ] && [ "$c" -eq 1 -a "$cc" -gt 0 ] then mpvctui_header2 "Chapterlist" mpvc "${MPVC_CMD_CHAPTERLIST}" From 3e8852ec58d4daa97d67e3c3bb9b2fed6db82116 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:12:41 +0100 Subject: [PATCH 066/122] docs: Update docs/now/index.html --- docs/now/index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/now/index.html b/docs/now/index.html index 24521dd8..7be40745 100644 --- a/docs/now/index.html +++ b/docs/now/index.html @@ -107,15 +107,18 @@

    Scrobbling Code

    } + +

    - Last-Modified: Thursday, 29 February 2023 by gmt4 + πŸ“… Tue, 19 Now 2024 by gmt4 - Powered by #HTML 🧑 πŸ’š πŸ’™ + ⚑ PoweredBy #HTML

    + From 137275cded9f647db7e5b4fa597e2b2307740767 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:40:28 +0100 Subject: [PATCH 067/122] Update mpvc --- mpvc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mpvc b/mpvc index e8c4ba86..5c4820c8 100755 --- a/mpvc +++ b/mpvc @@ -1111,8 +1111,8 @@ main() { ytquery) shift; mpvc_ytquery "$@"; return;; ytqueryjson) shift; mpvc_ytquery_json "$@"; return;; - cprev|--chapter-prev|chapter-prev) mpvc_chapter_set +1 "relative" ;; - cnext|--chapter-next|chapter-next) mpvc_chapter_set -1 "relative" ;; + cprev|--chapter-prev|chapter-prev) mpvc_chapter_set -1 "relative" ;; + cnext|--chapter-next|chapter-next) mpvc_chapter_set +1 "relative" ;; cplay|--chapter-play|chapter-play) shift; mpvc_chapter_set "${1:-}" "absolute" ;; cplayrand|--cplayrand) shift; mpvc_chapter_set "$(mpvc_get_random)" "absolute" ;; From e594b898a23e14ecd3f18caca977f9af8b3196c4 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Fri, 22 Nov 2024 18:40:22 +0100 Subject: [PATCH 068/122] extras: Update extras/mpvc-fzf --- extras/mpvc-fzf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf index 0d388041..0ad1cd57 100755 --- a/extras/mpvc-fzf +++ b/extras/mpvc-fzf @@ -251,7 +251,7 @@ mpvcfzf_fetch_remove() mpvcfzf_preview() { - MPVC_FZF_BIND_HELP="C-x:list C-v:yt-dlp C-\\:local C-s:chapter C-t:add C-o:play C-r:reload C-spc:toggle" + MPVC_FZF_BIND_HELP="C-u:go C-x:ls C-v:yt C-\\:fs C-s:chapter C-t:add C-o:play C-r:reload C-spc:toggle" # --bind='ctrl-d:execute(mpvc {q})' # --bind='left:execute-silent(mpvc -q seek -20 &)' \ # --bind='right:execute-silent(mpvc -q seek +20 &)' \ From c9dd5cfc4e4b1feab335f1409e5db062b5db4aa7 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Fri, 22 Nov 2024 20:01:51 +0100 Subject: [PATCH 069/122] extras: Update extras/mpvc-fzf --- extras/mpvc-fzf | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf index 0ad1cd57..511748d2 100755 --- a/extras/mpvc-fzf +++ b/extras/mpvc-fzf @@ -165,7 +165,7 @@ mpvcfzf_icache_output_dir() { else MPVC_YTDL_OUTPUT=$(mpvcfzf_icache_output) MPVC_YTDL_OUTPUT=${MPVC_YTDL_OUTPUT%/*} - eval echo $MPVC_YTDL_OUTPUT + echo "$MPVC_YTDL_OUTPUT" | sed "s|^~|$HOME|" fi } @@ -225,30 +225,6 @@ mpvcfzf_fetch() "$ytdlp" $ytdl_opts ${YTDL_OPTS:-} "$@" } -mpvcfzf_fetch_remove() -{ - if [ -z "$1" ]; then - mpvcfzf_warn "$PROGNAME: Error missing ytdl-video-id to remove" - return - fi - ytdl_id="$1" - - ytdl_json=$(mpvc getr ytdl-raw-options) - ytdl_archive=$(echo $ytdl_json | jq -r '.data."download-archive"') - ytdl_output=$(echo $ytdl_json | jq -r ".data.output") - ytdl_archive=$(eval echo $ytdl_archive) - ytdl_dir=$(dirname $ytdl_output) - ytdl_dir=$(eval echo $ytdl_dir) - - if [ -z "$ytdl_json" -o ! -r "$ytdl_archive" -o ! -n "$ytdl_output" ]; then - mpvcfzf_warn "$PROGNAME: Error cache not enabled: undefined ytdl-raw-options" - return - fi - - rm -i "$(find "$ytdl_dir" | grep "$ytdl_id")" - sed -i "/$ytdl_id/ s|^|#|" "$ytdl_archive" -} - mpvcfzf_preview() { MPVC_FZF_BIND_HELP="C-u:go C-x:ls C-v:yt C-\\:fs C-s:chapter C-t:add C-o:play C-r:reload C-spc:toggle" @@ -395,6 +371,11 @@ mpvcfzf_ddg() }' } +mpvcfzf_lofi() +{ + mpvcfzf_urlbrowser "${1:-https://lofigirl.com/wp-content/uploads/2023/06/}" +} + mpvcfzf_somafm() { chan=${1:-} @@ -521,11 +502,10 @@ main() -o|osearch) shift; mpvcfzf_isearch_once "$arg1" ;; # lucky -O|Osearch) shift; mpvcfzf_isearch_once "$arg1" | mpvcfzf_awk1 | mpvc load ;; # lucky - -#O) mpvcfzf_icache_output_dir ;; + -OO) shift; mpvcfzf_icache_output_dir ;; -p|splay) shift; mpvcfzf_iplay "$arg1" | mpvc load; return ;; -P|Splay) shift; mpvcfzf_iplay "$arg1" | mpvc loadc; return ;; - -r|remove) shift; mpvcfzf_fetch_remove "$arg1"; return ;; -s|search) shift; mpvcfzf_isearch "$arg1"; return;; -x|launch) shift; mpvcfzf_launch_term "$@"; exit ;; -y|related) shift; mpvcfzf_related_search "$arg1"; return ;; @@ -533,7 +513,7 @@ main() -v|version) shift; mpvcfzf_version; return ;; now) shift; mpvcfzf_now; return ;; - lofi) shift; mpvcfzf_urlbrowser "${1:-https://lofigirl.com/wp-content/uploads/2023/06/}" ;; + lofi) shift; mpvcfzf_lofi "${1:-}"; return ;; somafm) shift; mpvcfzf_somafm "${1:-}"; return ;; radioapi) shift; mpvcfzf_radioapi "${1:-}"; return ;; #*) shift; mpvcfzf_usage; return ;; From cc79ed86cfc33c4197224392a5125208f15c0b04 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Fri, 22 Nov 2024 20:23:09 +0100 Subject: [PATCH 070/122] Update mpvc --- mpvc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mpvc b/mpvc index 5c4820c8..73517a29 100755 --- a/mpvc +++ b/mpvc @@ -371,11 +371,10 @@ mpvc_get_playlist() { { gsub("^ *", "", url) ytitle=url - if (url ~ "^https?:") + if (url ~ "^https?:" && url ~ "youtu.be|youtube.com|yewtu.be") { ytcmd=sprintf("%s ytquery \"%s\"", mpvc, url) - ytcmd | getline ytitle # TBD - #if (!ytitle) mpvc " ytquery " url | getline ytitle + ytcmd | getline ytitle gsub("\\\\u00", "\\x", ytitle) gsub("\\\\x22", "\x22", ytitle) From b2ed4c049d29d0bd5d56bd2f3494f08afe330309 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 23 Nov 2024 05:55:37 +0100 Subject: [PATCH 071/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 73517a29..0d0ce626 100755 --- a/mpvc +++ b/mpvc @@ -371,7 +371,7 @@ mpvc_get_playlist() { { gsub("^ *", "", url) ytitle=url - if (url ~ "^https?:" && url ~ "youtu.be|youtube.com|yewtu.be") + if (url ~ "^https?://(youtu.be|(www.)?youtube.com|yewtu.be)") { ytcmd=sprintf("%s ytquery \"%s\"", mpvc, url) ytcmd | getline ytitle From 8cb2b21efc9621e5977c9c980efe45cdb30ae598 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 23 Nov 2024 06:25:52 +0100 Subject: [PATCH 072/122] Update mpvc --- mpvc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mpvc b/mpvc index 0d0ce626..9c303ccf 100755 --- a/mpvc +++ b/mpvc @@ -228,7 +228,7 @@ mpvc_curl_cache_json() mpvc_curl_cache "https://youtube.com/oembed?url=$1" } -mpvc_ytquery_json_once() { +mpvc_ytquery_json() { for i in "$@" do filename="${i:-}" @@ -256,10 +256,6 @@ mpvc_ytquery_json_once() { done } -mpvc_ytquery_json() { - mpvc_ytquery_json_once "$@" -} - # fn args: given a file/url return its title (may use curl to query YT) mpvc_ytquery() { mpvc_ytquery_json "$@" | mpvc_getjson 'title' From 76b4547e03c4d2fc0c8f69976e1736a3e42b4559 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Tue, 26 Nov 2024 07:40:20 +0100 Subject: [PATCH 073/122] Update mpvc --- mpvc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mpvc b/mpvc index 9c303ccf..cbbad666 100755 --- a/mpvc +++ b/mpvc @@ -296,14 +296,13 @@ mpvc_setr() { mpvc_ecmdr "set_property" "$@"; } mpvc_get_playlist_json() { mpvc_cmdr "get_property" "playlist" | - grep -o '"data":\[.*\]' | - awk '{ sub("^\"data\":",""); gsub("{\"filename\":","\n\t{\"filename\":"); } ! /^\[\]$/ { sub("]$","\n]"); } {print}' + grep -Eo '"[^"]*" *(: *([0-9]*|"[^"]*")[^{}\["]*|,)?|[^"\]\[\}\{]*|\{|\},?|\[|\],?|[0-9 ]*,?' QUIETFLAG="true" } mpvc_get_playlist_once() { mpvc_get_playlist_json | - sed 's|,"current":true||; s|,"playing":true||; s|,"id":[0-9]*||; s|{"filename":"\(.*\)"}|\1|; s|","title":.*||; s/,$//; /^\[$/d; /\]$/d' | + sed -n '/"\(current\|playing\)":true/d; /"\(id\|title\)":.*/d; s|"filename":"\(.*\)",|\1|p;' | awk -v numbered="${1:-}" ' { gsub("^[ \t]*", " ") From 2231c4a6dd202a03db5aee3d3b6194faaca80d06 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:08:02 +0100 Subject: [PATCH 074/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index cbbad666..721448d8 100755 --- a/mpvc +++ b/mpvc @@ -302,7 +302,7 @@ mpvc_get_playlist_json() { mpvc_get_playlist_once() { mpvc_get_playlist_json | - sed -n '/"\(current\|playing\)":true/d; /"\(id\|title\)":.*/d; s|"filename":"\(.*\)",|\1|p;' | + sed -n 's|"filename":"\(.*\)",\?|\1|p' | awk -v numbered="${1:-}" ' { gsub("^[ \t]*", " ") From 56f94fce2323bdf16693440fed3b4a78c26e67a5 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Wed, 27 Nov 2024 07:41:04 +0100 Subject: [PATCH 075/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 721448d8..8d18e9a5 100755 --- a/mpvc +++ b/mpvc @@ -302,7 +302,7 @@ mpvc_get_playlist_json() { mpvc_get_playlist_once() { mpvc_get_playlist_json | - sed -n 's|"filename":"\(.*\)",\?|\1|p' | + sed -n 's|"filename":"\(.*\)",*|\1|p' | awk -v numbered="${1:-}" ' { gsub("^[ \t]*", " ") From 9f162ecc13c9c5aeb6d00157c920306a77d2e4d3 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:42 +0100 Subject: [PATCH 076/122] extras: Update extras/mpvc-autostart --- extras/mpvc-autostart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-autostart b/extras/mpvc-autostart index 2faef340..0bbe22d6 100755 --- a/extras/mpvc-autostart +++ b/extras/mpvc-autostart @@ -8,7 +8,7 @@ # PROGNAME=${0##*/} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" From bc216f2da6740b5dec775c1b78384bc8f64e5e39 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:42 +0100 Subject: [PATCH 077/122] extras: Update extras/mpvc-chapter --- extras/mpvc-chapter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-chapter b/extras/mpvc-chapter index 30fe565c..dcd52160 100755 --- a/extras/mpvc-chapter +++ b/extras/mpvc-chapter @@ -8,7 +8,7 @@ # PROGNAME=${0##*/} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" From f20703c45f041b69f85614fa83628b8564dd80c8 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:42 +0100 Subject: [PATCH 078/122] extras: Update extras/mpvc-cut --- extras/mpvc-cut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-cut b/extras/mpvc-cut index 5b9cf44c..895e3374 100755 --- a/extras/mpvc-cut +++ b/extras/mpvc-cut @@ -8,7 +8,7 @@ # PROGNAME=${0##*/} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" From 6ef28af22218cd9f80a460fff323bba433f49c79 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:42 +0100 Subject: [PATCH 079/122] extras: Update extras/mpvc-equalizer --- extras/mpvc-equalizer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-equalizer b/extras/mpvc-equalizer index dcc9a30a..181cf213 100755 --- a/extras/mpvc-equalizer +++ b/extras/mpvc-equalizer @@ -9,7 +9,7 @@ PROGNAME=${0##*/} PROGDIR=${0%/*} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" From 536399b2aa9ea3a176cb7a122f2310f83574cac8 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:42 +0100 Subject: [PATCH 080/122] extras: Update extras/mpvc-fzf --- extras/mpvc-fzf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf index 511748d2..d49cc0df 100755 --- a/extras/mpvc-fzf +++ b/extras/mpvc-fzf @@ -9,7 +9,7 @@ PROGNAME=${0##*/} PROGDIR=${0%/*} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" From 93bf8cc75a24763aadf5200d66f1871f46be7d40 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:42 +0100 Subject: [PATCH 081/122] extras: Update extras/mpvc-installer --- extras/mpvc-installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-installer b/extras/mpvc-installer index e2cb5cef..f0a143f8 100755 --- a/extras/mpvc-installer +++ b/extras/mpvc-installer @@ -9,7 +9,7 @@ # PROGNAME=${0##*/} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" From 9f66bdd4cbe3d64ba08f6c06b545ec5a8de23c10 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:42 +0100 Subject: [PATCH 082/122] extras: Update extras/mpvc-mpris --- extras/mpvc-mpris | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-mpris b/extras/mpvc-mpris index c2d25665..e46575db 100755 --- a/extras/mpvc-mpris +++ b/extras/mpvc-mpris @@ -8,7 +8,7 @@ # PROGNAME=${0##*/} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" From 97cb4094b7654928ac9cddf261c29485d288af36 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:43 +0100 Subject: [PATCH 083/122] extras: Update extras/mpvc-tui --- extras/mpvc-tui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index 22838f8d..1480e748 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -8,7 +8,7 @@ # PROGNAME=${0##*/} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" SITEURL="https://gmt4.github.io/mpvc" From ce0a22001559fac7fe3874324e5889d4944d08ec Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:56:43 +0100 Subject: [PATCH 084/122] extras: Update extras/mpvc-web --- extras/mpvc-web | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-web b/extras/mpvc-web index a0335d9a..5711ed3c 100755 --- a/extras/mpvc-web +++ b/extras/mpvc-web @@ -16,7 +16,7 @@ PROGNAME=${0##*/} PROGDIR=${0%/*} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" PROGINFO="A hack to remotely control mpvc from web # DISCLAIMER * Use at Your Own Risk *" From 79e21c237892a0faadd5cc6ead602423690544bb Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 05:57:12 +0100 Subject: [PATCH 085/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 8d18e9a5..e9de0a7b 100755 --- a/mpvc +++ b/mpvc @@ -8,7 +8,7 @@ PROGNAME=${0##*/} PROGDIR=${0%/*} -PROGVERSION="v1.5" +PROGVERSION="v1.6" PROGAUTHOR=gmt4 PROGURL="https://github.com/gmt4/mpvc" SITEURL="https://gmt4.github.io/mpvc" From aeb5c6efba78e1fc3dd1496b3e3d3d98648f608d Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:20:00 +0100 Subject: [PATCH 086/122] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 00f27a71..945e0fce 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ nix-env -i mpvc ### mpvc ```console -usage: mpvc opts # @version v1.5 (c) gmt4 https://github.com/gmt4/mpvc +usage: mpvc opts # @version v1.6 (c) gmt4 https://github.com/gmt4/mpvc -a | --add : Add media to playlist (see --load for stdin). -s | --stop : Always stop playback. -P | --play : Always start playback. @@ -184,15 +184,13 @@ usage: mpvc opts # @version v1.5 (c) gmt4 https://github.com/gmt4/mpvc -v | --vol : Increase/decrease volume relative to current volume. -h | --help : Prints the short help. -H | --long-help : Prints the long help. - *tips: If unsure about where to begin, have a look at https://gmt4.github.io/mpvc - ``` ### mpvc-tui ```console -usage: mpvc-tui opts # @version v1.5 (c) gmt4 https://github.com/gmt4/mpvc +usage: mpvc-tui opts # @version v1.6 (c) gmt4 https://github.com/gmt4/mpvc -d|dir : Set the WD to the media directory given as argument -n|notify : Desktop notification using notify on mpvc events (notify-send*) -s|suggest : Suggest a random media to play based on previous media played @@ -208,7 +206,7 @@ usage: mpvc-tui opts # @version v1.5 (c) gmt4 https://github.com/gmt4/mpvc ### mpvc-fzf ```console -usage: mpvc-fzf opts # @version v1.5 (c) gmt4 https://github.com/gmt4/mpvc +usage: mpvc-fzf opts # @version v1.6 (c) gmt4 https://github.com/gmt4/mpvc -b|browse : Browse the provided ytdl-archive URL with fzf -c|chapters : Start fzf to manage the current mpv chapterlist -d|dir : Set the WD to the media directory given as argument @@ -225,7 +223,9 @@ usage: mpvc-fzf opts # @version v1.5 (c) gmt4 https://github.com/gmt4/mpvc -y|related : Search related media on Invidious -Y|Related : Search & play related media using Invidious -x|launch : Starts mpvc-fzf in a new xterm (config $MPVC_TERM) [combine -x with other opts] - -v|version : Prints the mpvc-fzf version. + -v|version : Return the mpvc-fzf version. + now : Return a shareable URL to the now listening playlist + lofi : Search & play Lo-Fi channels somafm : Search & play SomaFM channels radioapi : Search & play Radio-Browser API channels *tips: If unsure about where to begin, start: mpvc-fzf -p 'kupla mirage' From 4dcba7f40303fa8a40e40aaeaebddb0b48e71a69 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:07:13 +0100 Subject: [PATCH 087/122] Update mpvc --- mpvc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/mpvc b/mpvc index e9de0a7b..edd97192 100755 --- a/mpvc +++ b/mpvc @@ -28,7 +28,7 @@ usage: $PROGNAME opts # @version $PROGVERSION (c) $PROGAUTHOR $PROGURL -I | --fullplaylist : Print all filenames of tracks in current playlist. -v | --vol : Increase/decrease volume relative to current volume. -h | --help : Prints the short help. - -H | --long-help : Prints the long help. + -H | --help-long : Prints the long help. EOF if [ $# -gt 0 ]; then @@ -61,7 +61,8 @@ EOF -V | --volume : Set absolute volume. -Q | --vid=no : Start mpv with video output disabled. -- | : After adding files options after -- are passed to mpv. - | --version : Prints the $PROGNAME version. + | --version : Prints the short version. + | --version-long : Prints the long version. get : Get MPV property from $PROGNAME socket. set : Set MPV property from $PROGNAME socket. @@ -977,8 +978,10 @@ mpvc_validate_socket() { mpvc_get_version() { echo "version: $PROGNAME # @version $PROGVERSION (c) $PROGAUTHOR $PROGURL (forks lwillets/mpvc)" - echo - "$MPVC_MPV" --version + if [ $# -gt 0 ]; then + echo + "$MPVC_MPV" --version + fi } mpvc_idleloop() { $MPVC_SOCAT -t0 -,ignoreeof "$MPVC_SOCKET"; } @@ -1008,8 +1011,8 @@ main() { -k|--kill|kill|-K|--killall|killall) ;; -c|--crop|crop|-C|--clear|clear|cmd|sockcmd|socklist|--socklist) ;; -a|add|append|-A|load|--load|playnext|--playnext|-n|playnow|--playnow|mpv|--mpv|stash|--stash|--toggle|toggle|-q|--quiet) ;; - version|--version|-Q|--vid=no|-S|--socket) ;; - help|--help|-h|long-help|--long-help|-H|--list-options) ;; + version|--version|version-long|--version-long|-Q|--vid=no|-S|--socket) ;; + help|--help|-h|help-long|--help-long|-H|--list-options) ;; *) mpvc_validate_socket;; # otherwise, validate socket esac for arg in "$@"; do @@ -1156,10 +1159,11 @@ main() { -q|--quiet) QUIETFLAG=true; ;; --color|color) unset NO_COLOR ;; --nocolor|nocolor) export NO_COLOR=true ;; - --version|version) mpvc_get_version; exit 0; ;; + --version|version) mpvc_get_version; exit 0; ;; + --version-long|version-long) mpvc_get_version "$@"; exit 0; ;; --list-options) usage; exit 0; ;; -h|--help|h|help) usage; exit 0; ;; - -H|--long-help|long-help) usage "$@"; exit 0; ;; + -H|--help-long|help-long) usage "$@"; exit 0; ;; -?) usage "$@"; exit 1; ;; esac if [ $# -ge 1 ]; then shift; fi From 93a7c4b2b9fe127f2105190f2bd157a2424afe9a Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:53:52 +0100 Subject: [PATCH 088/122] extras: Update extras/mpvc-tui --- extras/mpvc-tui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index 1480e748..d1fbceaf 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -282,7 +282,7 @@ mpvctui_mouse_events() mpvctui_notify() { # $MPVC_TUI_SCROBBLER: scrobbling file contains one entry per line with tab-separated fields - cmd_notify='notify-send -u normal -i info "$(mpvc)";' + cmd_notify='notify-send -u normal -i info "mpvc" "$(mpvc)";' cmd_scrobble='echo $(mpvc expand-text "$(date +%s)\t\\${=duration}\t\\${path}\t\\${media-title}") >> '"$MPVC_TUI_SCROBBLER" awk -v cmd_scrobble="${1:-$cmd_scrobble}" -v cmd_notify="${2:-$cmd_notify}" ' From 454c7a29a571be2cbd4d1236188654ce91e816f7 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:33:47 +0100 Subject: [PATCH 089/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index edd97192..5f3dcbef 100755 --- a/mpvc +++ b/mpvc @@ -873,7 +873,7 @@ mpvc_print_status() { ) # trim/replace times: 00:01:59 -> 01:59 mpvc_cmd "expand-text" "${F}" | - awk '{ gsub(" \\\\r","\n"); gsub(" 00:", " "); gsub("/00:", "/"); print }' + awk '{ gsub(" \\\\r","\n"); gsub(" -?00:", " "); gsub("/00:", "/"); print }' } mpvc_print_status_final() { From 0f2db5c3163a81a2b990b40a7fe6479e10ca5e19 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:32:14 +0100 Subject: [PATCH 090/122] extras: Update extras/mpvc-tui --- extras/mpvc-tui | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/extras/mpvc-tui b/extras/mpvc-tui index d1fbceaf..68a65f85 100755 --- a/extras/mpvc-tui +++ b/extras/mpvc-tui @@ -48,6 +48,7 @@ mpvctui_defaults() MPVC_TUI_COLOR2="${MPVC_TUI_COLOR2:-$MPVC_TUI_CYELLOW}" MPVC_TUI_UPDATEC=${MPVC_TUI_UPDATEC:-2} MPVC_TUI_CLEARC=${MPVC_TUI_CLEARC:-4} + MPVC_TUI_ICON=${MPVC_TUI_ICON:-} MPVC_TUI_HEADER0=${MPVC_TUI_HEADER0:-$PROGNAME} MPVC_TUI_TIPS=${MPVC_TUI_TIPS:-true} @@ -139,15 +140,15 @@ mpvctui_tips() mpvctui_watcher() { - c=$(mpvc get playlist-count) - cc=$(mpvc get chapters) + c=$(equiet mpvc get playlist-count) + cc=$(equiet mpvc get chapters) mpvctui_header0 "${MPVC_TUI_HEADER0}$(mpvctui_tips)" mpvctui_header1 "Status" mpvc "${MPVC_CMD_STATUS}" mpvctui_header1 "Playlist" mpvc "${MPVC_CMD_PLAYLIST}" - if [ "$cc" != "null" ] && [ "$c" -eq 1 -a "$cc" -gt 0 ] + if [ "${c:-}" != "" ] && [ "${cc:-}" != "null" ] && [ "$c" -eq 1 -a "$cc" -gt 0 ] then mpvctui_header2 "Chapterlist" mpvc "${MPVC_CMD_CHAPTERLIST}" @@ -282,7 +283,7 @@ mpvctui_mouse_events() mpvctui_notify() { # $MPVC_TUI_SCROBBLER: scrobbling file contains one entry per line with tab-separated fields - cmd_notify='notify-send -u normal -i info "mpvc" "$(mpvc)";' + cmd_notify='notify-send -u normal -i "'"$MPVC_TUI_ICON"'" "mpvc" "$(mpvc)";' cmd_scrobble='echo $(mpvc expand-text "$(date +%s)\t\\${=duration}\t\\${path}\t\\${media-title}") >> '"$MPVC_TUI_SCROBBLER" awk -v cmd_scrobble="${1:-$cmd_scrobble}" -v cmd_notify="${2:-$cmd_notify}" ' From d7bf925b17f163a162c480ddfb422cff303b0bb7 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 2 Dec 2024 21:01:14 +0100 Subject: [PATCH 091/122] extras: Update extras/mpvc-web --- extras/mpvc-web | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/extras/mpvc-web b/extras/mpvc-web index 5711ed3c..1a30437d 100755 --- a/extras/mpvc-web +++ b/extras/mpvc-web @@ -89,9 +89,9 @@ mpvc_web_config() mpvc_web_style() { cat <<-EOF -:root { --body-font-family: monospace; --body-color: #222; --body-background: #fff; --link-color: #a0a; } -@media (max-width: 768px) { :root { --body-font-size: 1.06em; } } -@media (min-width: 768px) { :root { --body-font-size: 1.10em; } } +:root { --body-font-family: monospace,monospace; --body-color: #222; --body-background: #fff; --link-color: #a0a; } +@media (max-width: 768px) { :root { --body-font-size: 0.92em; } } +@media (min-width: 768px) { :root { --body-font-size: 1.00em; } } @media (prefers-color-scheme: light) { html { filter: invert(0.0); } :root { } } @media (prefers-color-scheme: dark) { html { filter: invert(0.85); } :root { } } @@ -312,8 +312,6 @@ mpvc_web_index() 🎧$MPVC_WEB_HOSTNAME mpvc - @@ -428,7 +426,7 @@ mpvc_web_index() #lyrics #file ]
    - + [ Playlist full @@ -437,8 +435,8 @@ mpvc_web_index() load ]
    - -