summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorshdown <shdownnine@gmail.com>2014-09-20 15:08:32 +0400
committerwm4 <wm4@nowhere>2014-09-20 15:18:49 +0200
commit5332ecf6517b61e556ed154a3e503f6c79d58211 (patch)
tree63d89849bae523124969a1de7d5ba96adfbff0d1 /TOOLS
parent68b7217d41f3f5344e60001b0b365d47a180d6e8 (diff)
downloadmpv-5332ecf6517b61e556ed154a3e503f6c79d58211.tar.bz2
mpv-5332ecf6517b61e556ed154a3e503f6c79d58211.tar.xz
TOOLS/umpv: use MPV environment variable, not UMPV_OPTIONS
Just like the rest of TOOLS/*.sh scripts.
Diffstat (limited to 'TOOLS')
-rwxr-xr-xTOOLS/umpv18
1 files changed, 8 insertions, 10 deletions
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)