diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-05-01 15:41:13 +0300 |
---|---|---|
committer | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-05-01 16:07:05 +0300 |
commit | 02fbdf8aaffac527ce33c81ace001b48aee9e953 (patch) | |
tree | 255eb90976ed7c46390a133ce817edd5d3e5ced5 /player/lua/defaults.lua | |
parent | f3b2ea9de533ac3ee0ebdaaf6411c97212f5a86b (diff) | |
download | mpv-02fbdf8aaffac527ce33c81ace001b48aee9e953.tar.bz2 mpv-02fbdf8aaffac527ce33c81ace001b48aee9e953.tar.xz |
scripting (lua/js): utils.getpid: make wrapper of pid property
We now have at least 3 scripting APIs which are trivial wrappers
around properties: mp.get_mouse_pos, utils.getcwd, utils.getpid.
After some discussion on IRC it was decided that it's easier for us to
maintain them as trivial wrappers than to deprecate them and inflict
pain on users and script authors, so currently no plan to deprecate.
Diffstat (limited to 'player/lua/defaults.lua')
-rw-r--r-- | player/lua/defaults.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua index 920ee425aa..0fe90977e6 100644 --- a/player/lua/defaults.lua +++ b/player/lua/defaults.lua @@ -747,6 +747,10 @@ function mp_utils.getcwd() return mp.get_property("working-directory") end +function mp_utils.getpid() + return mp.get_property_number("pid") +end + function mp_utils.format_bytes_humanized(b) local d = {"Bytes", "KiB", "MiB", "GiB", "TiB", "PiB"} local i = 1 |