mirror of
https://github.com/mpv-player/mpv
synced 2025-03-21 10:51:51 +00:00
TOOLS/umpv: use MPV environment variable, not UMPV_OPTIONS
Just like the rest of TOOLS/*.sh scripts.
This commit is contained in:
parent
68b7217d41
commit
5332ecf651
18
TOOLS/umpv
18
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-*
|
echo "cycle fullscreen" > /tmp/umpv-fifo-*
|
||||||
|
|
||||||
Note: you can supply custom options with the UMPV_OPTIONS environment variable.
|
Note: you can supply custom mpv path and options with the MPV environment
|
||||||
The environment variable will be split on whitespace, and each item is
|
variable. The environment variable will be split on whitespace, and the
|
||||||
passed as option to mpv _if_ the script starts mpv. If mpv is not started
|
first item is used as path to mpv binary and the rest is passed as options
|
||||||
by the script (i.e. mpv is already running), the options will be ignored.
|
_if_ the script starts mpv. If mpv is not started by the script (i.e. mpv
|
||||||
|
is already running), this will be ignored.
|
||||||
|
|
||||||
Warning:
|
Warning:
|
||||||
|
|
||||||
@ -68,9 +69,6 @@ def make_abs(filename):
|
|||||||
return filename
|
return filename
|
||||||
files = [make_abs(f) for f in files]
|
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 = "/tmp/umpv-fifo-" + os.getenv("USER")
|
||||||
|
|
||||||
fifo_fd = -1
|
fifo_fd = -1
|
||||||
@ -114,9 +112,9 @@ else:
|
|||||||
raise e
|
raise e
|
||||||
os.mkfifo(FIFO, int("0600", 8))
|
os.mkfifo(FIFO, int("0600", 8))
|
||||||
|
|
||||||
opts = ["mpv", "--no-terminal", "--force-window", "--input-file=" + FIFO]
|
opts = (os.getenv("MPV") or "mpv").split()
|
||||||
opts.extend(opts_env)
|
opts.extend(["--no-terminal", "--force-window", "--input-file=" + FIFO,
|
||||||
opts.append("--")
|
"--"])
|
||||||
opts.extend(files)
|
opts.extend(files)
|
||||||
|
|
||||||
subprocess.check_call(opts)
|
subprocess.check_call(opts)
|
||||||
|
Loading…
Reference in New Issue
Block a user