Conversation
mainly so that env vars can be accessed from within input.conf.
|
I don't think it's a good idea to allow environmental variables snooping. We already allow clipboard snooping and it isn't quite liked feature, see #17367. |
Yes, and this feature can be implemented by a simple lua script, it's not worth adding a property for it. add this script, and then you can access environment variable through ${user-data/env/...} in input.conf local utils = require('mp.utils')
local env = {}
for _, v in ipairs(utils.get_env_list()) do
local i = v:find('=', 1, true)
env[v:sub(1, i - 1)] = v:sub(i + 1)
end
mp.set_property_native('user-data/env', env) |
This isn't even remotely comparable.
|
|
You can easily read environment variable in scripts of course, but config files are more convenient for users. (The above script doesn't work for mpv.conf). Notably there are no This has been requested in #mpv a few times and the implementation is trivial so I think it's a fine addition. |
kasper93
left a comment
There was a problem hiding this comment.
I don't think unpredictable config behavior based on current runtime env is a good thing. But there seems to be strong need for this features, so it's fine.
these properties cannot be used directly and require a sub-property. document this explicitly.
mainly so that env vars can be accessed from within input.conf.