From 5332ecf6517b61e556ed154a3e503f6c79d58211 Mon Sep 17 00:00:00 2001 From: shdown Date: Sat, 20 Sep 2014 15:08:32 +0400 Subject: TOOLS/umpv: use MPV environment variable, not UMPV_OPTIONS Just like the rest of TOOLS/*.sh scripts. --- TOOLS/umpv | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'TOOLS') diff --git a/TOOLS/umpv b/TOOLS/umpv index 69aeb8a54a..29affe2437 100755 --- a/TOOLS/umpv +++ b/TOOLS/umpv @@ -23,10 +23,11 @@ Note that you can control the mpv instance by writing to the command fifo: echo "cycle fullscreen" > /tmp/umpv-fifo-* -Note: you can supply custom options with the UMPV_OPTIONS environment variable. - The environment variable will be split on whitespace, and each item is - passed as option to mpv _if_ the script starts mpv. If mpv is not started - by the script (i.e. mpv is already running), the options will be ignored. +Note: you can supply custom mpv path and options with the MPV environment + variable. The environment variable will be split on whitespace, and the + first item is used as path to mpv binary and the rest is passed as options + _if_ the script starts mpv. If mpv is not started by the script (i.e. mpv + is already running), this will be ignored. Warning: @@ -68,9 +69,6 @@ def make_abs(filename): return filename files = [make_abs(f) for f in files] -opts_env = os.getenv("UMPV_OPTIONS") -opts_env = opts_env.split() if opts_env else [] - FIFO = "/tmp/umpv-fifo-" + os.getenv("USER") fifo_fd = -1 @@ -114,9 +112,9 @@ else: raise e os.mkfifo(FIFO, int("0600", 8)) - opts = ["mpv", "--no-terminal", "--force-window", "--input-file=" + FIFO] - opts.extend(opts_env) - opts.append("--") + opts = (os.getenv("MPV") or "mpv").split() + opts.extend(["--no-terminal", "--force-window", "--input-file=" + FIFO, + "--"]) opts.extend(files) subprocess.check_call(opts) -- cgit v1.2.3